HeapAllocator
Description
Create an allocator descriptor backed by the process heap. The returned allocator uses malloc/realloc/free semantics, with aligned allocation where required by the requested alignment.
Success
Returns a heap-backed allocator descriptor.
Failure
Function cannot fail.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Allocator.c:120:
}
Allocator HeapAllocator(void) {
return (Allocator) {
.state = NULL,- In
Allocator.c:135:
Allocator AllocatorBind(Allocator alloc) {
Allocator heap = HeapAllocator();
if (!alloc.allocate) { WriteFmt("Testing BitVecClone allocator inheritance\n");
Allocator alloc = HeapAllocator();
alloc.effort = ALLOCATOR_EFFORT_RETRY_FALLBACK;
alloc.retry_limit = 9;- In
Float.Type.c:65:
WriteFmt("Testing FloatClone allocator inheritance\n");
Allocator alloc = HeapAllocator();
alloc.effort = ALLOCATOR_EFFORT_RETRY_FALLBACK;
alloc.retry_limit = 6;- In
Int.Type.c:62:
WriteFmt("Testing IntClone allocator inheritance\n");
Allocator alloc = HeapAllocator();
alloc.effort = ALLOCATOR_EFFORT_RETRY_FALLBACK;
alloc.retry_limit = 5;- In
Str.Init.c:205:
WriteFmt("Testing Str clone allocator inheritance\n");
Allocator alloc = HeapAllocator();
alloc.effort = ALLOCATOR_EFFORT_RETRY_FALLBACK;
alloc.retry_limit = 7;- In
Vec.Insert.c:314:
typedef Vec(int) IntVec;
Allocator alloc = HeapAllocator();
alloc.effort = ALLOCATOR_EFFORT_RETRY_FALLBACK;
alloc.retry_limit = 11;- In
Allocator.h:151:
/// TAGS: Allocator, Macro, Default, Memory
///
#define DefaultAllocator() HeapAllocator()
#endif // MISRA_STD_ALLOCATOR_H
Last updated on