Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 606 Bytes

README.md

File metadata and controls

18 lines (15 loc) · 606 Bytes

jemalloc-zig

CI
Implementation of std.mem.Allocator interface that wraps Jemalloc. Works on master builds of Zig.

Example usage

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

const jemalloc_zig = @import("jemalloc-zig");
const gpa = jemalloc_zig.jemalloc_allocator;

pub fn main() !void {
    const memory = try gpa.alloc(i32, 1);
    memory[0] = 12;
    gpa.free(memory);
}