@@ -861,20 +861,20 @@ provide let print = (value, suffix="\n") => {
861
861
// First convert the value to string, if it isn't one already.
862
862
let valuePtr = WasmI32.fromGrain(value)
863
863
let s = toString(value)
864
- let ptr = WasmI32.fromGrain(s )
865
- let suffixPtr = WasmI32.fromGrain(suffix )
866
- // iov: [<ptr to string> <nbytes of string> <ptr to end sequence> <nbytes of end sequence>] (32 bytes)
864
+ let combined = concat(s, suffix )
865
+ let ptr = WasmI32.fromGrain(combined )
866
+ // iov: [<ptr to string> <nbytes of string>]
867
867
// buf: <iov> <written>
868
868
// fd_write(STDOUT (1), iov, len(iov), written)
869
- let buf = Memory.malloc(36n )
869
+ let buf = Memory.malloc(20n )
870
870
let iov = buf
871
- let written = buf + 32n
871
+ let written = buf + 16n
872
872
WasmI32.store(iov, ptr + 8n, 0n)
873
873
WasmI32.store(iov, WasmI32.load(ptr, 4n), 4n)
874
- WasmI32.store(iov, suffixPtr + 8n, 8n)
875
- WasmI32.store(iov, WasmI32.load(suffixPtr, 4n), 12n)
876
- fd_write(1n, iov, 2n, written)
874
+ fd_write(1n, iov, 1n, written)
877
875
Memory.free(buf)
876
+ ignore(value)
877
+ ignore(suffix)
878
878
void
879
879
}
880
880
0 commit comments