SafeAllocator on wasm32-wasi

There is this in std/start.zig:

const use_safe_allocator = !is_wasm and switch (builtin.mode) {
    .Debug, .ReleaseSafe => true,
    .ReleaseFast, .ReleaseSmall => !builtin.link_libc and builtin.single_threaded, // Also not ideal.
};

What is the rationale behind the !is_wasm check? I can’t find any unsupported feature in the implementation, but maybe I’m missing something. Maybe it is because wasm programs usually aren’t long-lived, or to save memory, or something along those lines?

WASM is always single-threaded, so why would it use thread-safe allocator?

Mostly to use the leak / double-free / write-after-free / etc. detection features of SafeAllocator. But I may have misunderstood something here, as you seem to imply that SafeAllocator is tailored solely toward thread safety?

Sorry, I got it confused. I thought this meant the older thread-safe allocator, that got removed.

No problem. But speaking of the older thread-safe allocator removal and the “recent” deprecation of DebugAllocator, I wonder if this !is_wasm check is an unnecessary leftover from the related migration…