#include "config.h"#include "system.h"#include "alloc-pool.h"#include "hashtab.h"

Go to the source code of this file.
Data Types | |
| type | allocation_object_def |
Defines | |
| #define | align_eight(x) (((x+7) >> 3) << 3) |
| #define | ALLOCATION_OBJECT_PTR_FROM_USER_PTR(X) |
| #define | USER_PTR_FROM_ALLOCATION_OBJECT_PTR(X) ((void *) (((allocation_object *) (X))->u.data)) |
Typedefs | |
| typedef struct allocation_object_def | allocation_object |
Functions/Subroutines | |
| alloc_pool | create_alloc_pool (const char *name, size_t size, size_t num) |
| void | free_alloc_pool (alloc_pool pool) |
| void | free_alloc_pool_if_empty (alloc_pool *pool) |
| void * | pool_alloc (alloc_pool pool) |
| void | pool_free (alloc_pool pool, void *ptr) |
| void | dump_alloc_pool_statistics (void) |
| #define align_eight | ( | x | ) | (((x+7) >> 3) << 3) |
Definition at line 28 of file alloc-pool.c.
| #define ALLOCATION_OBJECT_PTR_FROM_USER_PTR | ( | X | ) |
Value:
((allocation_object *) (((char *) (X)) \ - offsetof (allocation_object, u.data)))
Definition at line 53 of file alloc-pool.c.
| #define USER_PTR_FROM_ALLOCATION_OBJECT_PTR | ( | X | ) | ((void *) (((allocation_object *) (X))->u.data)) |
Definition at line 58 of file alloc-pool.c.
| alloc_pool create_alloc_pool | ( | const char * | name, | |
| size_t | size, | |||
| size_t | num | |||
| ) |
Definition at line 120 of file alloc-pool.c.
References align_eight, alloc_pool_def::block_list, alloc_pool_def::block_size, alloc_pool_def::blocks_allocated, alloc_pool_def::elt_size, alloc_pool_def::elts_allocated, alloc_pool_def::elts_free, alloc_pool_def::elts_per_block, alloc_pool_def::free_list, gcc_assert, last_id, alloc_pool_def::name, NULL, offsetof, pool, pool_size, and xmalloc().
| void free_alloc_pool | ( | alloc_pool | pool | ) |
Definition at line 185 of file alloc-pool.c.
References alloc_pool_def::block_list, alloc_pool_def::block_size, free(), gcc_assert, memset, alloc_pool_def::name, alloc_pool_list_def::next, and NULL.
| void free_alloc_pool_if_empty | ( | alloc_pool * | pool | ) |
Definition at line 212 of file alloc-pool.c.
References free_alloc_pool(), and NULL.
Referenced by et_free_pools().
| void* pool_alloc | ( | alloc_pool | pool | ) |
Definition at line 223 of file alloc-pool.c.
References align_eight, ALLOCATION_OBJECT_PTR_FROM_USER_PTR, alloc_pool_def::block_list, alloc_pool_def::block_size, alloc_pool_def::blocks_allocated, alloc_pool_def::elt_size, alloc_pool_def::elts_allocated, alloc_pool_def::elts_free, alloc_pool_def::elts_per_block, alloc_pool_def::free_list, gcc_assert, i, alloc_pool_def::name, alloc_pool_list_def::next, USER_PTR_FROM_ALLOCATION_OBJECT_PTR, xmalloc(), and XNEWVEC.
| void pool_free | ( | alloc_pool | pool, | |
| void * | ptr | |||
| ) |
Definition at line 288 of file alloc-pool.c.
References ALLOCATION_OBJECT_PTR_FROM_USER_PTR, alloc_pool_def::elt_size, alloc_pool_def::elts_allocated, alloc_pool_def::elts_free, alloc_pool_def::free_list, gcc_assert, memset, alloc_pool_list_def::next, and offsetof.
1.5.6