A lightweight implementation of Zig's std.mem.Allocator interface that wraps around Microsoft's mimalloc.
Use this library as a Zig library (instructions here) and then add something like this to your root source file:
const mimalloc = @import("mimalloc-zig-wrapper");
const mi = mimalloc.mimalloc_allocator;
pub fn main() !void {
const memory = try mi.alloc(i32, 1);
memory[0] = 12;
mi.free(memory);
}
You might have to go into build.zig
and fix up the paths to point to the right libraries.
zig build
zig build test