AllocatorUnbind
Description
Release allocator runtime state bound to an object. This does not free allocations owned by containers; it only tears down the allocator’s internal state object and resets state to NULL.
Parameters
| Name | Direction | Description |
|---|---|---|
alloc |
in,out | Allocator to unbind |
Success
Function cannot fail.
Failure
No action is taken when alloc is NULL.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Allocator.c:219:
}
void AllocatorUnbind(Allocator *alloc) {
if (!alloc) {
return;- In
Graph.c:461:
graph->mutation_epoch = 0;
graph->alignment = 0;
AllocatorUnbind(&graph->allocator);
graph->allocator = AllocatorBind(DefaultAllocator());
graph->type_anchor = NULL;- In
Vec.c:92:
vec->length = 0;
vec->capacity = 0;
AllocatorUnbind(&vec->allocator);
vec->allocator = AllocatorBind(DefaultAllocator());
}- In
List.c:41:
list->copy_deinit = NULL;
list->length = 0;
AllocatorUnbind(&list->allocator);
list->allocator = AllocatorBind(DefaultAllocator());
}- In
BitVec.c:64:
bitvec->capacity = 0;
bitvec->byte_size = 0;
AllocatorUnbind(&bitvec->allocator);
bitvec->allocator = AllocatorBind(DefaultAllocator());
}- In
BitVec.c:1427:
AllocatorFree(&scratch, prev_row, (len2 + 1) * sizeof(u64), _Alignof(u64));
AllocatorFree(&scratch, curr_row, (len2 + 1) * sizeof(u64), _Alignof(u64));
AllocatorUnbind(&scratch);
return false;
}- In
BitVec.c:1459:
AllocatorFree(&scratch, prev_row, (len2 + 1) * sizeof(u64), _Alignof(u64));
AllocatorFree(&scratch, curr_row, (len2 + 1) * sizeof(u64), _Alignof(u64));
AllocatorUnbind(&scratch);
return true;- In
Map.c:442:
AllocatorFree(&map->allocator, map->entries, map->capacity * entry_size, map_storage_alignment());
AllocatorFree(&map->allocator, map->states, map->capacity * sizeof(u8), map_storage_alignment());
AllocatorUnbind(&map->allocator);
map->entries = NULL;
Last updated on