9 ms·
Doesn't every WASM program have to carry its own malloc/free today?
by ridiculous_fish 1y ago
Doesn't every WASM program have to carry its own malloc/free today?
- phickey 1y agoYes, every wasm program that uses linear memory (which includes all those created by llvm toolchains) must ship with its own allocator. You only get to use the wasm GC provided allocator if your program is using the gc types, which can’t be stored in a linear memory.
- flohofwoe 1y agoYes, but Emscripten comes with a minimal allocator that's good enough for most C code (e.g. code with low alloc/free frequency) and only adds minimal size overhead: https://github.com/emscripten-core/emscripten/blob/main/system/lib/emmalloc.c https://github.com/emscripten-core/emscripten/blob/main/syst...