AllocatorBind
Description
Prepare an allocator for object binding. Missing allocation callbacks are filled from the default heap allocator and the runtime state pointer is reset so each bound object starts with a fresh allocator instance state.
Parameters
| Name | Direction | Description |
|---|---|---|
alloc |
in | Allocator template to bind |
Success
Returns a bound allocator descriptor.
Failure
Function cannot fail.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Allocator.c:134:
}
Allocator AllocatorBind(Allocator alloc) {
Allocator heap = HeapAllocator();- In
Graph.c:462:
graph->alignment = 0;
AllocatorUnbind(&graph->allocator);
graph->allocator = AllocatorBind(DefaultAllocator());
graph->type_anchor = NULL;
graph->__magic = 0;- In
Vec.c:67:
vec->data = NULL;
vec->alignment = alignment;
vec->allocator = AllocatorBind(allocator);
vec->__magic = MISRA_VEC_MAGIC;
}- In
Vec.c:93:
vec->capacity = 0;
AllocatorUnbind(&vec->allocator);
vec->allocator = AllocatorBind(DefaultAllocator());
}- In
List.c:42:
list->length = 0;
AllocatorUnbind(&list->allocator);
list->allocator = AllocatorBind(DefaultAllocator());
}- In
BitVec.c:65:
bitvec->byte_size = 0;
AllocatorUnbind(&bitvec->allocator);
bitvec->allocator = AllocatorBind(DefaultAllocator());
}- In
BitVec.c:1418:
}
scratch = AllocatorBind(bv1->allocator);
// Dynamic programming matrix
- In
Map.c:462:
map->policy.next_index = NULL;
map->policy.max_probe_count = 0;
map->allocator = AllocatorBind(DefaultAllocator());
map->__magic = 0;
}- In
Init.h:208:
.states = NULL, \
.policy = validate_map_policy_copy((policy_value)), \
.allocator = AllocatorBind(DefaultAllocator()), \
.__magic = MISRA_MAP_MAGIC}- In
Init.h:191:
.data = NULL, \
.alignment = (aln), \
.allocator = AllocatorBind((alloc)), \
.__magic = MISRA_VEC_MAGIC}- In
Init.h:58:
.copy_deinit = (GenericCopyDeinit)(cd), \
.length = 0, \
.allocator = AllocatorBind((alloc)), \
.__magic = MISRA_LIST_MAGIC}- In
Init.h:90:
.data = NULL, \
.byte_size = 0, \
.allocator = AllocatorBind(DefaultAllocator()), \
.__magic = MISRA_BITVEC_MAGIC \
})- In
Init.h:99:
.data = NULL, \
.byte_size = 0, \
.allocator = AllocatorBind((alloc)), \
.__magic = MISRA_BITVEC_MAGIC \
})- In
Init.h:109:
.data = NULL, \
.byte_size = 0, \
.allocator = AllocatorBind(DefaultAllocator()), \
.__magic = MISRA_BITVEC_MAGIC})
# define BitVecInit_1(alloc) \- In
Init.h:116:
.data = NULL, \
.byte_size = 0, \
.allocator = AllocatorBind((alloc)), \
.__magic = MISRA_BITVEC_MAGIC})
#endif- In
Init.h:136:
.mutation_epoch = 0, \
.alignment = (aln), \
.allocator = AllocatorBind((alloc)), \
.type_anchor = NULL, \
.__magic = MISRA_GRAPH_MAGIC}
Last updated on