Go to the source code of this file.
Data Structures | |
struct | slot_header_ |
struct | used_header_ |
struct | block_header |
struct | large_block_header |
struct | mempool_type |
Typedefs | |
typedef gni_mem_handle_t | mem_handle_t |
typedef void *(* | mempool_newblockfn )(size_t *size, mem_handle_t *mem_hndl, int expand_flag) |
typedef void(* | mempool_freeblock )(void *ptr, mem_handle_t mem_hndl) |
typedef struct slot_header_ | slot_header |
typedef struct used_header_ | used_header |
typedef used_header | mempool_header |
Functions | |
static_assert (sizeof(slot_header)%16==0,"slot_header is not a multiple of 16 bytes") | |
static_assert (sizeof(used_header)%16==0,"used_header is not a multiple of 16 bytes") | |
static_assert (sizeof(block_header)%16==0,"block_header is not a multiple of 16 bytes") | |
static_assert (sizeof(large_block_header)%16==0,"large_block_header is not a multiple of 16 bytes") | |
static_assert (sizeof(mempool_type)%16==0,"mempool_type is not a multiple of 16 bytes") | |
mempool_type * | mempool_init (size_t pool_size, mempool_newblockfn newfn, 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 (mempool_type *mptr, void *ptr_free) |
void | mempool_free_thread (void *ptr_free) |
void * | getNextRegisteredPool () |
typedef CmiInt8 mem_handle_t |
typedef void*(* mempool_newblockfn)(size_t *size, mem_handle_t *mem_hndl, int expand_flag) |
typedef void(* mempool_freeblock)(void *ptr, mem_handle_t mem_hndl) |
typedef struct slot_header_ slot_header |
typedef struct used_header_ used_header |
typedef used_header mempool_header |
static_assert | ( | sizeof(slot_header)% | 16 = =0 , |
|
"slot_header is not a multiple of 16 bytes" | ||||
) |
static_assert | ( | sizeof(used_header)% | 16 = =0 , |
|
"used_header is not a multiple of 16 bytes" | ||||
) |
static_assert | ( | sizeof(block_header)% | 16 = =0 , |
|
"block_header is not a multiple of 16 bytes" | ||||
) |
static_assert | ( | sizeof(large_block_header)% | 16 = =0 , |
|
"large_block_header is not a multiple of 16 bytes" | ||||
) |
static_assert | ( | sizeof(mempool_type)% | 16 = =0 , |
|
"mempool_type is not a multiple of 16 bytes" | ||||
) |
mempool_type* mempool_init | ( | size_t | pool_size, | |
mempool_newblockfn | newfn, | |||
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 | ( | 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().
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* getNextRegisteredPool | ( | ) |