PPL Logo

arch/util/mempool.h File Reference

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_typemempool_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 Documentation

Definition at line 11 of file mempool.h.

typedef void*(* mempool_newblockfn)(size_t *size, mem_handle_t *mem_hndl, int expand_flag)

Definition at line 18 of file mempool.h.

typedef void(* mempool_freeblock)(void *ptr, mem_handle_t mem_hndl)

Definition at line 19 of file mempool.h.

typedef struct slot_header_ slot_header

typedef struct used_header_ used_header

Definition at line 71 of file mempool.h.


Function Documentation

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 
)

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  ) 

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void* getNextRegisteredPool (  ) 


Generated on Mon Sep 21 08:11:02 2020 for Charm++ by  doxygen 1.5.5