GCC Middle and Back End API Reference
|
#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 |
|
inlinestaticprivate |
|
inline |
Allocates one element from the pool specified.
References base_pool_allocator< TBlockAllocator >::allocation_object::data, header, base_pool_allocator< TBlockAllocator >::allocation_pool_list::next, NULL, offsetof, pool_allocator_usage, and VALGRIND_DISCARD.
Referenced by object_allocator< T >::allocate(), object_allocator< T >::allocate_raw(), new_cselib_val(), and onepart_pool_allocate().
|
inlineprivate |
Initialize a pool allocator.
References base_pool_allocator< TBlockAllocator >::allocation_object::data, gcc_checking_assert, last_id, pool_usage::m_element_size, pool_usage::m_pool_name, offsetof, and pool_allocator_usage.
|
inline |
Number of elements currently active (not returned to pool). Used for cheap consistency checks.
Referenced by object_allocator< T >::num_elts_current().
|
inline |
Free all memory allocated for the given memory pool.
References after_memory_report, base_pool_allocator< TBlockAllocator >::allocation_pool_list::next, NULL, and pool_allocator_usage.
Referenced by cselib_finish(), object_allocator< T >::release(), and vt_finalize().
|
inline |
Referenced by object_allocator< T >::release_if_empty().
|
inline |
Puts PTR back on POOL's free list.
References base_pool_allocator< TBlockAllocator >::allocation_object::data, gcc_assert, header, base_pool_allocator< TBlockAllocator >::allocation_pool_list::next, offsetof, pool_allocator_usage, and VALGRIND_DISCARD.
Referenced by object_allocator< T >::remove(), object_allocator< T >::remove_raw(), variable_htab_free(), and fibonacci_heap< K, V >::~fibonacci_heap().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |