MCPcopy Create free account
hub / github.com/acl-dev/acl / acl_allocator_pool_add

Function acl_allocator_pool_add

lib_acl/src/stdlib/memory/acl_allocator.c:183–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183ACL_MEM_POOL *acl_allocator_pool_add(ACL_ALLOCATOR *allocator,
184 const char *label, size_t obj_size, acl_mem_type type,
185 void (*after_alloc_fn)(void *obj, void *pool_ctx),
186 void (*before_free_fn)(void *obj, void *pool_ctx), void *pool_ctx)
187{
188 const char *myname = "acl_allocator_pool_add";
189 ACL_MEM_POOL *pool;
190
191 CHECK_TYPE(type);
192
193 pool = allocator->pool_create_fn();
194 pool->label = label;
195 pool->obj_size = obj_size;
196#if DEBUG_MEMPOOL
197 pool->real_obj_size = (obj_size & 7) ? (obj_size | 7) + 1 : obj_size;
198#endif
199 pool->type = type;
200 pool->after_alloc_fn = after_alloc_fn;
201 pool->before_free_fn = before_free_fn;
202 pool->pool_ctx = pool_ctx;
203 pool->pstack = acl_stack_create(1000);
204
205 allocator->MemPools[type] = pool;
206 acl_stack_append(allocator->pools, pool);
207
208 return pool;
209}
210
211void acl_allocator_pool_remove(ACL_ALLOCATOR *allocator, ACL_MEM_POOL *pool)
212{

Callers 2

mem_pool_createFunction · 0.85
vstring_pool_createFunction · 0.85

Calls 2

acl_stack_createFunction · 0.85
acl_stack_appendFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…