Skip to content

Commit f66a045

Browse files
committed
address comments: add missing free
1 parent 8b1959f commit f66a045

File tree

5 files changed

+8
-2
lines changed

5 files changed

+8
-2
lines changed

wasm/zlib/benchmark.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ class Benchmark {
2020
throw new Error("Length after decompression doesn't match");
2121
}
2222
}
23+
24+
Module._free(inputzoutStr);
25+
Module._free(inputzStr);
26+
Module._free(inputStr);
2327
}
2428

2529
validate() {

wasm/zlib/build.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Built on 2025-02-11T11:31:02Z
1+
Built on 2025-02-12T12:38:44Z
22
Toolchain versions
33
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.73 (ac676d5e437525d15df5fd46bc2c208ec6d376a3)
44
Getting zpipe.c example source...

wasm/zlib/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ emcc -o build/zlib.js \
2121
-s WASM=1 -O2 \
2222
-g1 --emit-symbol-map \
2323
-s USE_ZLIB=1 -s FORCE_FILESYSTEM=1 \
24-
-s MODULARIZE=1 -s EXPORT_NAME=setupModule -s EXPORTED_RUNTIME_METHODS=FS,stringToNewUTF8 -s EXPORTED_FUNCTIONS=_compressFile,_decompressFile \
24+
-s MODULARIZE=1 -s EXPORT_NAME=setupModule -s EXPORTED_RUNTIME_METHODS=FS,stringToNewUTF8 -s EXPORTED_FUNCTIONS=_compressFile,_decompressFile,_free \
2525
src/zpipe.c src/main.c | tee -a "$BUILD_LOG"
2626
# If you want the native build for reference:
2727
# clang -o build/zlib -O2 -lz src/zpipe.c src/main.c

wasm/zlib/build/zlib.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3470,6 +3470,8 @@ var _decompressFile = Module["_decompressFile"] = (a0, a1) => (_decompressFile =
34703470

34713471
var _malloc = a0 => (_malloc = wasmExports["malloc"])(a0);
34723472

3473+
var _free = Module["_free"] = a0 => (_free = Module["_free"] = wasmExports["free"])(a0);
3474+
34733475
var __emscripten_stack_restore = a0 => (__emscripten_stack_restore = wasmExports["_emscripten_stack_restore"])(a0);
34743476

34753477
var __emscripten_stack_alloc = a0 => (__emscripten_stack_alloc = wasmExports["_emscripten_stack_alloc"])(a0);

wasm/zlib/build/zlib.wasm

7 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)