mimalloc
mimalloc copied to clipboard
Preliminary fixes and improvements to the wasm backend
The wasm backend seems to have bitrotted a bit, I couldn't get it to compile in the latest dev-slice branch, so I did some preliminary fixes and improvements. Summary of changes:
- Making the wasm
prim.ccompile again by adding missing includes and moving a few helper functions around. - Use the
__wasm__macro uniformly across the codebase. This is better than__wasi__since the linear memory characteristics really are not wasi-specific, and this macro works out of the box for both emscripten and wasi-sdk. - Remove redundant
__builtin_wasm_memory_growlogic in the wasm backend. We always usesbrkfor wasm at the moment, which works fine as long as the argument is a multiple of wasm page size. - Use
getentropyto fix the random buffer source for the wasm backend.getentropyis present in the sysroots of both emscripten and wasi-sdk.
@microsoft-github-policy-service agree