ARGOBOTS
dce6e727ffc4ca5b3ffc04cb9517c6689be51ec5
|
Go to the documentation of this file.
6 #ifndef ABTI_MEM_POOL_H_INCLUDED
7 #define ABTI_MEM_POOL_H_INCLUDED
9 #define ABT_MEM_POOL_MAX_LOCAL_BUCKETS 2
10 #define ABT_MEM_POOL_NUM_RETURN_BUCKETS 1
11 #define ABT_MEM_POOL_NUM_TAKE_BUCKETS 1
112 size_t header_size,
size_t header_offset,
size_t page_size,
114 uint32_t num_lp_type_requests,
size_t alignment_hint,
136 if (num_headers_in_cur_bucket == 1) {
138 if (bucket_index == 0) {
148 #if ABT_MEM_POOL_NUM_TAKE_BUCKETS > 1
150 for (j = 0; j < i; j++) {
167 p_local_pool->
buckets[bucket_index] = p_next;
170 *p_mem = (
void *)cur_bucket;
200 p_freed_header->
p_next = NULL;
203 p_freed_header->
p_next = cur_bucket;
207 p_local_pool->
buckets[bucket_index] = p_freed_header;
void ABTI_mem_pool_destroy_local_pool(ABTI_mem_pool_local_pool *p_local_pool)
int ABT_bool
Boolean type.
#define ABT_MEM_POOL_NUM_RETURN_BUCKETS
struct ABTI_mem_pool_header ABTI_mem_pool_header
uint32_t num_lp_type_requests
#define ABT_MEM_POOL_MAX_LOCAL_BUCKETS
struct ABTI_mem_pool_global_pool_mprotect_config ABTI_mem_pool_global_pool_mprotect_config
void ABTI_mem_pool_return_bucket(ABTI_mem_pool_global_pool *p_global_pool, ABTI_mem_pool_header *bucket)
#define ABTI_IS_ERROR_CHECK_ENABLED
union ABTI_mem_pool_header_bucket_info ABTI_mem_pool_header_bucket_info
#define ABT_MEM_POOL_NUM_TAKE_BUCKETS
struct ABTI_mem_pool_page * p_next_empty_page
ABTI_mem_pool_global_pool * p_global_pool
static ABTU_ret_err int ABTI_mem_pool_alloc(ABTI_mem_pool_local_pool *p_local_pool, void **p_mem)
struct ABTI_mem_pool_local_pool ABTI_mem_pool_local_pool
size_t num_headers_per_bucket
ABTU_align_member_var(ABT_CONFIG_STATIC_CACHELINE_SIZE) ABTI_sync_lifo bucket_lifo
#define ABTI_ASSERT(cond)
#define ABT_CONFIG_STATIC_CACHELINE_SIZE
ABTU_ret_err int ABTI_mem_pool_init_local_pool(ABTI_mem_pool_local_pool *p_local_pool, ABTI_mem_pool_global_pool *p_global_pool)
#define ABT_SUCCESS
Error code: the routine returns successfully.
ABTI_mem_pool_global_pool_mprotect_config mprotect_config
struct ABTI_mem_pool_global_pool ABTI_mem_pool_global_pool
ABTU_MEM_LARGEPAGE_TYPE lp_type_requests[4]
int ABTI_mem_pool_take_bucket(ABTI_mem_pool_global_pool *p_global_pool, ABTI_mem_pool_header **p_bucket)
ABTU_MEM_LARGEPAGE_TYPE lp_type
ABTI_mem_pool_header * partial_bucket
void ABTI_mem_pool_init_global_pool(ABTI_mem_pool_global_pool *p_global_pool, size_t num_headers_per_bucket, size_t header_size, size_t header_offset, size_t page_size, const ABTU_MEM_LARGEPAGE_TYPE *lp_type_requests, uint32_t num_lp_type_requests, size_t alignment_hint, ABTI_mem_pool_global_pool_mprotect_config *p_mprotect_config)
void ABTI_mem_pool_destroy_global_pool(ABTI_mem_pool_global_pool *p_global_pool)
static void ABTI_mem_pool_free(ABTI_mem_pool_local_pool *p_local_pool, void *mem)
ABTI_sync_lifo_element lifo_elem
struct ABTI_mem_pool_page ABTI_mem_pool_page
size_t num_headers_per_bucket
ABTI_mem_pool_header * buckets[ABT_MEM_POOL_MAX_LOCAL_BUCKETS]