Tighten up some function signatures.
This commit is contained in:
Kartik Agaram 2020-07-18 19:31:01 -07:00
parent 02b7f9bd89
commit 01b72aa064
2 changed files with 14 additions and 14 deletions

View File

@ -63,7 +63,7 @@ $array-equal-main:end:
# Allocate and clear 'n' bytes of memory from an allocation-descriptor 'ad'.
# Abort if there isn't enough memory in 'ad'.
allocate: # ad: (addr allocation-descriptor), n: int, out: (addr handle)
allocate: # ad: (addr allocation-descriptor), n: int, out: (addr handle _)
# . prologue
55/push-ebp
89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp
@ -100,7 +100,7 @@ $allocate:end:
# Claim the next 'n' bytes of memory starting at ad->curr and update ad->curr.
# Abort if there isn't enough memory in 'ad'.
allocate-raw: # ad: (addr allocation-descriptor), n: int, out: (addr handle)
allocate-raw: # ad: (addr allocation-descriptor), n: int, out: (addr handle _)
# . prologue
55/push-ebp
89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp
@ -253,7 +253,7 @@ test-allocate-raw-success:
5d/pop-to-ebp
c3/return
lookup: # h: (handle T) -> result/eax: (addr T)
lookup: # h: (handle _T) -> result/eax: (addr _T)
# . prologue
55/push-ebp
89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp
@ -455,7 +455,7 @@ _pending-test-lookup-failure:
c3/return
# when comparing handles, just treat them as pure values
handle-equal?: # a: handle, b: handle -> result/eax: boolean
handle-equal?: # a: (handle _T), b: (handle _T) -> result/eax: boolean
# . prologue
55/push-ebp
89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp
@ -486,7 +486,7 @@ $handle-equal?:end:
5d/pop-to-ebp
c3/return
copy-handle: # src: handle, dest: (addr handle)
copy-handle: # src: (handle _T), dest: (addr handle _T)
# . prologue
55/push-ebp
89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp
@ -573,7 +573,7 @@ $allocate-region:abort:
# Claim the next 'n+4' bytes of memory and initialize the first 4 to n.
# Abort if there isn't enough memory in 'ad'.
allocate-array: # ad: (addr allocation-descriptor), n: int, out: (addr handle)
allocate-array: # ad: (addr allocation-descriptor), n: int, out: (addr handle _)
# . prologue
55/push-ebp
89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp
@ -707,7 +707,7 @@ test-allocate-array:
5d/pop-to-ebp
c3/return
copy-array: # ad: (addr allocation-descriptor), src: (addr array), out: (addr handle)
copy-array: # ad: (addr allocation-descriptor), src: (addr array _T), out: (addr handle array _T)
# . prologue
55/push-ebp
89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp

14
400.mu
View File

@ -69,14 +69,14 @@ sig parse-hex-int-from-slice in: (addr slice) -> result/eax: int
sig is-hex-digit? c: byte -> result/eax: boolean
#sig from-hex-char in/eax: byte -> out/eax: nibble
sig error-byte ed: (addr exit-descriptor), out: (addr buffered-file), msg: (addr array byte), n: byte
#sig allocate ad: (addr allocation-descriptor), n: int, out: (addr handle)
#sig allocate-raw ad: (addr allocation-descriptor), n: int, out: (addr handle)
sig lookup h: (handle T) -> result/eax: (addr T)
sig handle-equal? a: handle, b: handle -> result/eax: boolean
sig copy-handle src: handle, dest: (addr handle)
#sig allocate ad: (addr allocation-descriptor), n: int, out: (addr handle _)
#sig allocate-raw ad: (addr allocation-descriptor), n: int, out: (addr handle _)
sig lookup h: (handle _T) -> result/eax: (addr _T)
sig handle-equal? a: (handle _T), b: (handle _T) -> result/eax: boolean
sig copy-handle src: (handle _T), dest: (addr handle _T)
#sig allocate-region ad: (addr allocation-descriptor), n: int, out: (addr handle allocation-descriptor)
#sig allocate-array ad: (addr allocation-descriptor), n: int, out: (addr handle)
sig copy-array ad: (addr allocation-descriptor), src: (addr array), out: (addr handle)
#sig allocate-array ad: (addr allocation-descriptor), n: int, out: (addr handle _)
sig copy-array ad: (addr allocation-descriptor), src: (addr array _T), out: (addr handle array _T)
#sig zero-out start: (addr byte), size: int
sig new-stream ad: (addr allocation-descriptor), length: int, elemsize: int, out: (addr handle stream _)
sig read-line-buffered f: (addr buffered-file), s: (addr stream byte)