scc  2022.4.0
SystemC components library
util::pool_allocator< ELEM_SIZE, CHUNK_SIZE > Class Template Reference

a generic pool allocator singleton not being MT-safe More...

#include <pool_allocator.h>

Public Member Functions

void * allocate (uint64_t id=0)
 
void free (void *p)
 pit the memory back into the pool More...
 
void resize ()
 add CHUNK_SIZE elements to the pool
 
 pool_allocator (const pool_allocator &)=delete
 deleted constructor
 
 pool_allocator (pool_allocator &&)=delete
 deleted constructor
 
 ~pool_allocator ()
 deleted destructor
 
pool_allocatoroperator= (const pool_allocator &)=delete
 deleted assignment operator
 
pool_allocatoroperator= (pool_allocator &&)=delete
 deleted assignment operator
 
size_t get_capacity ()
 get the number of allocated bytes
 
size_t get_free_entries_count ()
 get the number of free elements
 

Static Public Member Functions

static pool_allocatorget ()
 pool allocator getter
 

Detailed Description

template<size_t ELEM_SIZE, unsigned CHUNK_SIZE = 4096>
class util::pool_allocator< ELEM_SIZE, CHUNK_SIZE >

a generic pool allocator singleton not being MT-safe

Definition at line 42 of file pool_allocator.h.

Member Function Documentation

◆ free()

template<size_t ELEM_SIZE, unsigned CHUNK_SIZE>
void util::pool_allocator< ELEM_SIZE, CHUNK_SIZE >::free ( void *  p)
inline

pit the memory back into the pool

Parameters
p

Definition at line 216 of file pool_allocator.h.


The documentation for this class was generated from the following file: