const page_allocator: type = if (builtin.target.isWasm()) Allocator{ .ptr = undefined, .vtable = &WasmPageAllocator.vtable, } else if (builtin.target.os.tag == .plan9) Allocator{ .ptr = undefined, .vtable = &SbrkAllocator(std.os.plan9.sbrk).vtable, } else if (builtin.target.os.tag == .freestanding) root.os.heap.page_allocator else Allocator{ .ptr = undefined, .vtable = &PageAllocator.vtable, };
[src]
This allocator makes a syscall directly for every allocation and free. Thread-safe and lock-free.