| 225 | }; |
| 226 | |
| 227 | simple_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 | |
| 238 | void simple_allocator_destroy(simple_allocator_t *alloc) { free(alloc); } |
| 239 |