dispenso 1.4.1
A library for task parallelism
Loading...
Searching...
No Matches
Allocators

Memory allocation utilities. More...

Files

file  pool_allocator.h
 
file  small_buffer_allocator.h
 

Detailed Description

Memory allocation utilities.

Pool allocators and small buffer allocators for efficient memory management in parallel programs.

Example: SmallBufferAllocator

// Allocator for 64-byte buffers
dispenso::SmallBufferAllocator<64> allocator;
// Allocate and deallocate efficiently
char* buffer = allocator.alloc();
// ... use buffer ...
allocator.dealloc(buffer);

Example: PoolAllocator with Custom Backing

1024, // chunk size
1024 * 1024, // slab size
[](size_t n) { return malloc(n); },
[](void* p) { free(p); }
);
char* chunk = allocator.alloc();
// ... use chunk ...
allocator.dealloc(chunk);
DISPENSO_DLL_ACCESS char * alloc()