27 #ifndef INCLUDED_ALLOCATORS_POOL
28 #define INCLUDED_ALLOCATORS_POOL
33 namespace Allocators {
43 template<
typename T,
class Storage = Storage_Fixed<> >
220 #endif // #ifndef INCLUDED_ALLOCATORS_POOL
#define ROUND_UP(n, multiple)
void pool_free(Pool *p, void *el)
Make a fixed-size element available for reuse in the given Pool.
size_t MaxCapacity() const
provides a memory range that can be expanded but doesn't waste physical memory or relocate itself...
void * pool_alloc(Pool *p, size_t size)
Dole out memory from the pool.
#define ASSERT(expr)
same as ENSURE in debug mode, does nothing in release mode.
void * freelist
pointer to freelist (opaque); see freelist_*.
size_t pool_committed(Pool *p)
Return the number of bytes committed in the pool's backing array.
Status pool_create(Pool *p, size_t max_size, size_t el_size)
Ready Pool for use.
static uintptr_t StorageAppend(Storage &storage, size_t &end, size_t size)
static void * mem_freelist_Detach(void *&freelist)
size_t RemainingObjects()
allocator design parameters:
static const size_t objectSize
const size_t POOL_VARIABLE_ALLOCS
pass as pool_create's <el_size> param to indicate variable-sized allocs are required (see below)...
bool Contains(uintptr_t address) const
i64 Status
Error handling system.
#define T(string_literal)
allocator design parameters:
size_t el_size
size of elements.
void pool_free_all(Pool *p)
"free" all user allocations that ensued from the given Pool.
Status pool_destroy(Pool *p)
free all memory (address space + physical) that constitutes the given Pool.
void * mem_freelist_Sentinel()
uintptr_t Address() const
bool pool_contains(const Pool *p, void *el)
indicate whether a pointer was allocated from the given pool.
static void mem_freelist_AddToFront(void *&freelist, void *el)