#include <alloc-pool.h>
Data Structures | |
struct | allocation_object |
struct | allocation_pool_list |
Public Member Functions | |
base_pool_allocator (const char *name, size_t size CXX_MEM_STAT_INFO) | |
~base_pool_allocator () | |
void | release () |
void | release_if_empty () |
void * | allocate () ATTRIBUTE_MALLOC |
void | remove (void *object) |
size_t | num_elts_current () |
Private Member Functions | |
void | initialize () |
Static Private Member Functions | |
static size_t | align_eight (size_t x) |
Private Attributes | |
const char * | m_name |
ALLOC_POOL_ID_TYPE | m_id |
size_t | m_elts_per_block |
allocation_pool_list * | m_returned_free_list |
char * | m_virgin_free_list |
size_t | m_virgin_elts_remaining |
size_t | m_elts_allocated |
size_t | m_elts_free |
size_t | m_blocks_allocated |
allocation_pool_list * | m_block_list |
size_t | m_elt_size |
size_t | m_size |
bool | m_initialized |
mem_location | m_location |
Generic pool allocator.
|
inline |
|
inline |
References release(), and ~base_pool_allocator().
Referenced by ~base_pool_allocator().
|
inlinestaticprivate |
Referenced by allocate(), and initialize().
|
inline |
Allocates one element from the pool specified.
References align_eight(), base_pool_allocator< TBlockAllocator >::allocation_object::data, base_pool_allocator< TBlockAllocator >::allocation_object::get_data(), header, initialize(), m_block_list, m_blocks_allocated, m_elt_size, m_elts_allocated, m_elts_free, m_elts_per_block, m_id, m_initialized, m_returned_free_list, m_virgin_elts_remaining, m_virgin_free_list, base_pool_allocator< TBlockAllocator >::allocation_pool_list::next, NULL, offsetof, pool_allocator_usage, and VALGRIND_DISCARD.
Referenced by onepart_pool_allocate().
|
inlineprivate |
Initialize a pool allocator.
References align_eight(), base_pool_allocator< TBlockAllocator >::allocation_object::data, gcc_checking_assert, last_id, pool_usage::m_element_size, m_elt_size, m_elts_per_block, m_id, m_initialized, m_location, m_name, pool_usage::m_pool_name, m_size, offsetof, and pool_allocator_usage.
Referenced by allocate().
|
inline |
Number of elements currently active (not returned to pool). Used for cheap consistency checks.
References m_elts_allocated, and m_elts_free.
|
inline |
Free all memory allocated for the given memory pool.
References after_memory_report, m_block_list, m_blocks_allocated, m_elt_size, m_elts_allocated, m_elts_free, m_initialized, m_returned_free_list, m_virgin_elts_remaining, m_virgin_free_list, base_pool_allocator< TBlockAllocator >::allocation_pool_list::next, NULL, and pool_allocator_usage.
Referenced by release_if_empty(), and ~base_pool_allocator().
|
inline |
References m_elts_allocated, m_elts_free, and release().
|
inline |
Puts PTR back on POOL's free list.
References base_pool_allocator< TBlockAllocator >::allocation_object::data, gcc_assert, header, m_elt_size, m_elts_allocated, m_elts_free, m_id, m_initialized, m_returned_free_list, offsetof, pool_allocator_usage, and VALGRIND_DISCARD.
Referenced by variable_htab_free().
|
private |
Referenced by allocate(), base_pool_allocator(), and release().
|
private |
Referenced by allocate(), base_pool_allocator(), and release().
|
private |
Referenced by allocate(), base_pool_allocator(), initialize(), release(), and remove().
|
private |
Referenced by allocate(), base_pool_allocator(), num_elts_current(), release(), release_if_empty(), and remove().
|
private |
Referenced by allocate(), base_pool_allocator(), num_elts_current(), release(), release_if_empty(), and remove().
|
private |
Referenced by allocate(), base_pool_allocator(), and initialize().
|
private |
Referenced by allocate(), base_pool_allocator(), initialize(), and remove().
|
private |
Referenced by allocate(), base_pool_allocator(), initialize(), release(), and remove().
|
private |
Referenced by base_pool_allocator(), and initialize().
|
private |
Referenced by base_pool_allocator(), and initialize().
|
private |
Referenced by allocate(), base_pool_allocator(), release(), and remove().
|
private |
Referenced by base_pool_allocator(), and initialize().
|
private |
Referenced by allocate(), base_pool_allocator(), and release().
|
private |
Referenced by allocate(), base_pool_allocator(), and release().