From 747529e96bf61f1a2017224f956d4029e55fce42 Mon Sep 17 00:00:00 2001 From: Benjamin Feng Date: Tue, 19 Nov 2019 00:31:26 -0600 Subject: [PATCH] Use wasm_allocator --- lib/std/heap.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/heap.zig b/lib/std/heap.zig index 24ab395734..f251c83989 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,