scc 2025.09
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
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 43 of file pool_allocator.h.

Constructor & Destructor Documentation

◆ ~pool_allocator()

template<size_t ELEM_SIZE, unsigned CHUNK_SIZE>
util::pool_allocator< ELEM_SIZE, CHUNK_SIZE >::~pool_allocator ( )

deleted destructor

Definition at line 200 of file pool_allocator.h.

Member Function Documentation

◆ allocate()

template<size_t ELEM_SIZE, unsigned CHUNK_SIZE>
void * util::pool_allocator< ELEM_SIZE, CHUNK_SIZE >::allocate ( uint64_t id = 0)
inline

Definition at line 229 of file pool_allocator.h.

◆ 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 240 of file pool_allocator.h.

◆ get()

template<size_t ELEM_SIZE, unsigned CHUNK_SIZE>
pool_allocator< ELEM_SIZE, CHUNK_SIZE > & util::pool_allocator< ELEM_SIZE, CHUNK_SIZE >::get ( )
static

pool allocator getter

Definition at line 195 of file pool_allocator.h.

◆ get_capacity()

template<size_t ELEM_SIZE, unsigned CHUNK_SIZE>
size_t util::pool_allocator< ELEM_SIZE, CHUNK_SIZE >::get_capacity ( )
inline

get the number of allocated bytes

Definition at line 255 of file pool_allocator.h.

◆ get_free_entries_count()

template<size_t ELEM_SIZE, unsigned CHUNK_SIZE>
size_t util::pool_allocator< ELEM_SIZE, CHUNK_SIZE >::get_free_entries_count ( )
inline

get the number of free elements

Definition at line 259 of file pool_allocator.h.

◆ resize()

template<size_t ELEM_SIZE, unsigned CHUNK_SIZE>
void util::pool_allocator< ELEM_SIZE, CHUNK_SIZE >::resize ( )
inline

add CHUNK_SIZE elements to the pool

Definition at line 248 of file pool_allocator.h.


The documentation for this class was generated from the following file:
  • /home/eyck/Projects/MINRES/SystemC-Components/src/common/util/pool_allocator.h