You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Optimized for rapid small memory allocation/releasing
Reuse of OS provided allocations
Non-Blocking allocation & free within a thread
Multithreaded Capable
Automatic feature reduction for single threaded use
Safe freeing of memory sent to a different thread
Getting started
In Zig:
constadma=@Import("adma");
pubfnexample() !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 useconstadma_ref=adma.AdmaAllocator.init();
deferadma_ref.deinit();
constallocator=&adma_ref.allocator;
varbuf=tryallocator.alloc(u8, 100);
deferallocator.free(buf);
}
Usage Notes
If using adma in a multithreaded context, ensure you AdmaAllocator.init/deinit
in every thread; not pass the allocator pointer to the additional thread
If using for zig prior to the big allocation interface change, see the branch
called pre-allocator-revamp
About
A general purpose, multithreaded capable slab allocator for Zig