diff --git a/lib/std/heap.zig b/lib/std/heap.zig index 24ab39573413166287b42a79fd69dced5f4df7e7..f251c8398939a3a8b15f6924b150f468fde49e0a 100644 --- a/lib/std/heap.zig +++ b/lib/std/heap.zig @@ -33,7 +33,7 @@ fn cShrink(self: *Allocator, old_mem: []u8, old_align: u29, new_size: usize, new /// This allocator makes a syscall directly for every allocation and free. /// Thread-safe and lock-free. -pub const direct_allocator = &direct_allocator_state; +pub const direct_allocator = if (builtin.arch == .wasm32) wasm_allocator else &direct_allocator_state; var direct_allocator_state = Allocator{ .reallocFn = DirectAllocator.realloc, .shrinkFn = DirectAllocator.shrink,