| ... | @@ -33,7 +33,7 @@ fn cShrink(self: *Allocator, old_mem: []u8, old_align: u29, new_size: usize, new | ... | @@ -33,7 +33,7 @@ fn cShrink(self: *Allocator, old_mem: []u8, old_align: u29, new_size: usize, new |
| 33 | | 33 | |
| 34 | /// This allocator makes a syscall directly for every allocation and free. | 34 | /// This allocator makes a syscall directly for every allocation and free. |
| 35 | /// Thread-safe and lock-free. | 35 | /// Thread-safe and lock-free. |
| 36 | pub const direct_allocator = &direct_allocator_state; | 36 | pub const direct_allocator = if (builtin.arch == .wasm32) wasm_allocator else &direct_allocator_state; |
| 37 | var direct_allocator_state = Allocator{ | 37 | var direct_allocator_state = Allocator{ |
| 38 | .reallocFn = DirectAllocator.realloc, | 38 | .reallocFn = DirectAllocator.realloc, |
| 39 | .shrinkFn = DirectAllocator.shrink, | 39 | .shrinkFn = DirectAllocator.shrink, |