Library of Assembled Shared Sources
|
Custom allocator library.
This library provides a nice flexible set of custom allocators you can combine in anyway you like, as long as it makes sense.
There are in general two kind of allocator concepts: fixed-size and variable-size allocators, with the obvious meanings. The former is constructed with the requested block size and (de)allocates blocks of at least that size. The latter has a default constructor and the requested block size is passed at both allocation and deallocation. Some variable-size allocators (like AllocatorMalloc) also provide deallocate(void* mem) without the block size, but that's not a requirement.
There are bottom-level allocators (like AllocatorMalloc) that do real allocation work and exist on there own. And there are adaptor allocators (like AllocatorLocked) that extend/adapt another allocator to provide some extra functionality. Some of them (like AllocatorLocked) implement both the fixed-size and variable-size concept. Others (like AllocatorVariableSize) convert a fixed-size interface to variable-size.
On top of all that, there's AllocatorClassAdaptor you can use to overload class-specific new and delete using a variable-size allocator.