If you compile the following code:
const std = @import("std");
const allocator: std.mem.Allocator = .{
.ptr = undefined,
.vtable = &std.heap.WasmAllocator.vtable,
};
var sfb = std.heap.stackFallback(1024 * 1024 * 100, allocator);
pub fn main() void {
_ = sfb.get();
}
using the command:
zig build-exe test.zig -target wasm32-wasi -O ReleaseSmall
you’d get a really big WASM file:
-rwxr--r-- 1 cleong cleong 104858509 Aug 18 22:16 test.wasm
-rw-rw-r-- 1 cleong cleong 104859396 Aug 18 22:16 test.wasm.o
-rw-rw-r-- 1 cleong cleong 247 Aug 18 22:16 test.zig
Why is that?