#include <assert.h>
Include dependency graph for blockpool.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Compounds | |
class | big_block_alloc |
Support for the allocation of large memory blocks. More... | |
class | big_block_pool |
An implementation of pooled memory allocation that makes use of the large memory block allocation class, big_block_alloc. More... | |
class | block_pool |
An abstract base class for pooled memory allocation. More... | |
struct | block_pool.block_chain_struct |
Defines | |
#define | Chain_block(p) ((p)->block) |
#define | Chain_bytes_used(p) ((p)->bytes_used) |
#define | Chain_block_size(p) ((p)->block_size) |
#define | Chain_next(p) ((p)->next_block) |
These classes support allocation of memory pools. A memory pool is allocated in blocks and smaller chunks of memory are usually allocated from these blocks. The entire memory pool is deallocated at once.
The big_block_pool object creates a pool of large blocks. These are more time consuming to create initially (since they are initialized to zero), but they are, in theory, faster, since fewer of them will have to be created. The big_block_pool is designed for internal data structures that are large and have a relatively long live (like the Abstract Syntax Trees generated by a compiler front end).
The page_block_pool allocator is designed for short lived data pools. Creation of a page_block_pool is faster, but it is not, in theory, as efficient for large internal data structures. The data allocated by the page_block_pool object is also initialized to zero.
The "in theory" caveat above exists because in tests on Windows NT 4.0 the large block and the page block memory allocators are very similar in performance. In fact, contrary to expectation, the large block allocator is slightly slower in allocation, but much faster on deallocation.
Definition in file blockpool.h.
|
Definition at line 146 of file blockpool.h. Referenced by block_pool::new_block(), and block_pool::pool_alloc(). |
|
Definition at line 148 of file blockpool.h. Referenced by block_pool::new_block(), block_pool::pool_alloc(), and block_pool::print_block_pool_info(). |
|
Definition at line 147 of file blockpool.h. Referenced by block_pool::new_block(), block_pool::pool_alloc(), and block_pool::print_block_pool_info(). |
|
Definition at line 149 of file blockpool.h. Referenced by block_pool::add_block(), block_pool::free_pool(), block_pool::new_block(), and block_pool::print_block_pool_info(). |