Skip to content

Repository files navigation

mimalloc-zig-wrapper

A lightweight implementation of Zig's std.mem.Allocator interface that wraps around Microsoft's mimalloc.

Works with Zig 0.15.2.

Usage

Use this library as a Zig library (instructions here) and then add something like this to your root source file:

constmimalloc=@import("mimalloc-zig-wrapper");
constmi=mimalloc.mimalloc_allocator;
pubfnmain() !void {
constmemory=trymi.alloc(i32, 1);
memory[0] =12;
mi.free(memory);
}

Build

You might have to go into build.zig and fix up the paths to point to the right libraries.

zig build

Test

zig build test

About

A lightweight implementation of Zig's std.mem.Allocator interface that wraps around Microsoft's mimalloc.

Topics

Resources

Code of conduct

Contributing

Stars

10 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages