Go to the source code of this file.
Functions | |
INLINE_KEYWORD int | which_pow2 (size_t size) |
INLINE_KEYWORD void | fillblock (mempool_type *mptr, block_header *block_head, size_t pool_size, int expansion) |
int | checkblock (mempool_type *mptr, block_header *current, int power) |
void | removeblocks (mempool_type *mptr) |
mempool_type * | mempool_init (size_t pool_size, mempool_newblockfn allocfn, mempool_freeblock freefn, size_t limit) |
initialize mempool | |
void | mempool_destroy (mempool_type *mptr) |
void * | mempool_malloc (mempool_type *mptr, size_t size, int expand) |
void * | mempool_large_malloc (mempool_type *mptr, size_t size, int expand) |
void | mempool_free_thread (void *ptr_free) |
void | mempool_free (mempool_type *mptr, void *ptr_free) |
void * | getNextRegisteredPool (void *current) |
Variables | |
int | cutOffPoints [] |
Definition at line 43 of file mempool.C.
References cutOffPoints.
Referenced by fillblock(), mempool_free(), mempool_init(), and mempool_malloc().
INLINE_KEYWORD void fillblock | ( | mempool_type * | mptr, | |
block_header * | block_head, | |||
size_t | pool_size, | |||
int | expansion | |||
) |
Definition at line 57 of file mempool.C.
References slot_header_::block_ptr, CmiAbort(), cutOffPoints, block_header::freelists, slot_header_::gnext, slot_header_::gprev, left(), slot_header_::next, slot_header_::power, slot_header_::prev, slot_header_::size, slot_header_::status, and which_pow2().
Referenced by mempool_init(), and mempool_malloc().
int checkblock | ( | mempool_type * | mptr, | |
block_header * | current, | |||
int | power | |||
) |
Definition at line 121 of file mempool.C.
References slot_header_::block_ptr, cutOffPoints, block_header::freelists, slot_header_::gnext, slot_header_::gprev, slot_header_::next, slot_header_::power, slot_header_::prev, slot_header_::size, and slot_header_::status.
Referenced by mempool_malloc().
void removeblocks | ( | mempool_type * | mptr | ) |
Definition at line 192 of file mempool.C.
References mempool_type::block_head, block_header::block_next, block_header::block_prev, mempool_type::block_tail, mempool_type::freeblockfn, mempool_type::limit, block_header::mem_hndl, block_header::size, mempool_type::size, and block_header::used.
Referenced by mempool_malloc().
mempool_type* mempool_init | ( | size_t | pool_size, | |
mempool_newblockfn | allocfn, | |||
mempool_freeblock | freefn, | |||
size_t | limit | |||
) |
initialize mempool
Definition at line 228 of file mempool.C.
References mempool_type::block_head, block_header::block_next, block_header::block_prev, mempool_type::block_tail, CmiCreateLock(), fillblock(), mempool_type::freeblockfn, mempool_type::large_blocks, mempool_type::limit, block_header::mem_hndl, mempool_type::mempoolLock, block_header::mptr, block_header::msgs_in_recv, block_header::msgs_in_send, mempool_type::newblockfn, block_header::size, mempool_type::size, block_header::used, and which_pow2().
Referenced by CmiIsomallocBlockListNew().
void mempool_destroy | ( | mempool_type * | mptr | ) |
Definition at line 263 of file mempool.C.
References mempool_type::block_head, block_header::block_next, large_block_header::block_next, mempool_type::freeblockfn, mempool_type::large_blocks, block_header::mem_hndl, and large_block_header::mem_hndl.
Referenced by CmiIsomallocBlockListDelete(), and CmiIsomallocBlockListPup().
void* mempool_malloc | ( | mempool_type * | mptr, | |
size_t | size, | |||
int | expand | |||
) |
Definition at line 286 of file mempool.C.
References mempool_type::block_head, block_header::block_next, block_header::block_prev, slot_header_::block_ptr, mempool_type::block_tail, checkblock(), CmiAbort(), CmiLock(), CmiUnlock(), cutOffPoints, fillblock(), block_header::freelists, mempool_type::limit, block_header::mem_hndl, mempool_large_malloc(), mempool_type::mempoolLock, block_header::mptr, block_header::msgs_in_recv, block_header::msgs_in_send, mempool_type::newblockfn, slot_header_::next, slot_header_::prev, removeblocks(), block_header::size, mempool_type::size, slot_header_::status, block_header::used, and which_pow2().
Referenced by isomalloc_internal_alloc_block().
void* mempool_large_malloc | ( | mempool_type * | mptr, | |
size_t | size, | |||
int | expand | |||
) |
Definition at line 388 of file mempool.C.
References large_block_header::block_next, large_block_header::block_prev, used_header_::block_ptr, CmiUnlock(), mempool_type::large_blocks, large_block_header::mem_hndl, mempool_type::mempoolLock, large_block_header::mptr, large_block_header::msgs_in_recv, large_block_header::msgs_in_send, mempool_type::newblockfn, used_header_::size, mempool_type::size, large_block_header::size, and used_header_::status.
Referenced by mempool_malloc().
void mempool_free_thread | ( | void * | ptr_free | ) |
Definition at line 433 of file mempool.C.
References slot_header_::block_ptr, CmiLock(), CmiUnlock(), mempool_free(), mempool_type::mempoolLock, and slot_header_::status.
Referenced by CmiIsomallocFree().
void mempool_free | ( | mempool_type * | mptr, | |
void * | ptr_free | |||
) |
Definition at line 445 of file mempool.C.
References mempool_type::block_head, large_block_header::block_next, large_block_header::block_prev, slot_header_::block_ptr, CmiMyPe(), cutOffPoints, block_header::freelists, slot_header_::gnext, slot_header_::gprev, mempool_type::large_blocks, left(), large_block_header::mem_hndl, slot_header_::next, slot_header_::power, slot_header_::prev, size, slot_header_::size, large_block_header::size, slot_header_::status, block_header::used, and which_pow2().
Referenced by mempool_free_thread().
Initial value:
{64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824}
Definition at line 38 of file mempool.C.
Referenced by checkblock(), fillblock(), mempool_free(), mempool_malloc(), and which_pow2().