MCPcopy Create free account
hub / github.com/Netis/cloud-probe / simple_allocator_create

Function simple_allocator_create

cpworker/src/ring_buffer.c:227–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225};
226
227simple_allocator_t *simple_allocator_create(size_t capacity)
228{
229 simple_allocator_t *alloc = malloc(sizeof(simple_allocator_t));
230 if (!alloc)
231 return NULL;
232
233 atomic_store_relaxed(&alloc->capacity, capacity);
234 atomic_store_relaxed(&alloc->used, 0);
235 return alloc;
236}
237
238void simple_allocator_destroy(simple_allocator_t *alloc) { free(alloc); }
239

Callers 1

task_manager_newFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected