Home

Awesome

A.D.M.A - Acronyms Dont Mean Anything

Adma is a general purpose allocator for zig with the following features:

Getting started

In Zig:

const adma = @Import("adma");

pub fn example() !void {
    // .initWith using a c allocator
    //const adma_ref = try adma.AdmaAllocator.initWith(std.heap.c_allocator, 0);

    // .init defaults to using std.heap.page_allocator underneath for ease of use
    const adma_ref = adma.AdmaAllocator.init();
    defer adma_ref.deinit();

    const allocator = &adma_ref.allocator;

    var buf = try allocator.alloc(u8, 100);
    defer allocator.free(buf);
}

Usage Notes