What exactly is WasmAllocator?

The documentation doesn’t really say a whole lot:

This is intended to be merged into GeneralPurposeAllocator at some point.

Is it an allocator that for some reason works better in WASM than the GPA?

The description is in std.heap.wasm_allocator

This allocator is fast, small, and specific to WebAssembly. In the future, this will be the implementation automatically selected by GeneralPurposeAllocator when compiling in ReleaseSmall mode for wasm32 and wasm64 architectures. Until then, it is available here to play with.

2 Likes

It’s past time to make that foreshadowed change - the compiler has been using this allocator when building from source for 1.5 years now, autodocs uses it since my rewrite, and I’ve been using it in a personal project. It’s tried and true at this point.