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
101 size_t header_size,
size_t header_offset,
size_t page_size,
103 uint32_t num_lp_type_requests,
size_t alignment_hint);
124 if (num_headers_in_cur_bucket == 1) {
126 if (bucket_index == 0) {
136 #if ABT_MEM_POOL_NUM_TAKE_BUCKETS > 1
138 for (j = 0; j < i; j++) {
155 p_local_pool->
buckets[bucket_index] = p_next;
158 *p_mem = (
void *)cur_bucket;
188 p_freed_header->
p_next = NULL;
191 p_freed_header->
p_next = cur_bucket;
195 p_local_pool->
buckets[bucket_index] = p_freed_header;
void ABTI_mem_pool_destroy_local_pool(ABTI_mem_pool_local_pool *p_local_pool)
#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
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)
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)
#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.
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_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]