HeapAllocatorInitAligned
Description
Same as HeapAllocatorInit() but with a caller-supplied alignment floor (N, in bytes). N == 0 is silently coerced to
- Allocations whose effective alignment exceeds 16 are routed to
the XL passthrough so the bitmap-classed path can stay tied to its 16-byte slot grid.
HeapAllocator h = HeapAllocatorInitAligned(64);
Success
Returns a fully-initialised HeapAllocator value with the requested alignment floor recorded in base.alignment.
Failure
Cannot fail at macro-expansion time.
Usage example (Cross-references)
Usage examples (Cross-references)
static bool test_overaligned_alloc(void) {
HeapAllocator heap = HeapAllocatorInitAligned(64);
Allocator *alloc = ALLOCATOR_OF(&heap);- In
Vec.Access.c:175:
DefaultAllocator alloc = DefaultAllocatorInit();
HeapAllocator aligned8 = HeapAllocatorInitAligned(8);
// Create a vector of integers
- In
Vec.Access.c:231:
DefaultAllocator alloc = DefaultAllocatorInit();
HeapAllocator aligned8 = HeapAllocatorInitAligned(8);
// Create a vector of integers with default alignment (1)
- In
Vec.Access.c:301:
WriteFmt("Testing element stride round-trips values\n");
HeapAllocator alloc = HeapAllocatorInitAligned(16);
typedef Vec(u32) U32Vec;- In
Graph.Type.c:44:
WriteFmt("Testing Graph aligned init and node id layout\n");
HeapAllocator alloc = HeapAllocatorInitAligned(32);
typedef Graph(int) IntGraph;- In
Vec.Init.c:90:
WriteFmt("Testing VecInit with aligned allocator\n");
HeapAllocator aligned4 = HeapAllocatorInitAligned(4);
HeapAllocator aligned16 = HeapAllocatorInitAligned(16);- In
Vec.Init.c:91:
HeapAllocator aligned4 = HeapAllocatorInitAligned(4);
HeapAllocator aligned16 = HeapAllocatorInitAligned(16);
// Test with int type and 4-byte alignment
- In
Vec.Init.c:146:
WriteFmt("Testing VecInit with aligned allocator and deep copy\n");
HeapAllocator aligned8 = HeapAllocatorInitAligned(8);
// Test with struct type, custom copy/deinit functions, and 8-byte alignment
- In
Vec.Init.c:175:
// allocator's settings.
HeapAllocator h_default = HeapAllocatorInit();
HeapAllocator h8 = HeapAllocatorInitAligned(8);
HeapAllocator h16 = HeapAllocatorInitAligned(16);
HeapAllocator h32 = HeapAllocatorInitAligned(32);- In
Vec.Init.c:176:
HeapAllocator h_default = HeapAllocatorInit();
HeapAllocator h8 = HeapAllocatorInitAligned(8);
HeapAllocator h16 = HeapAllocatorInitAligned(16);
HeapAllocator h32 = HeapAllocatorInitAligned(32);
HeapAllocator h64 = HeapAllocatorInitAligned(64);- In
Vec.Init.c:177:
HeapAllocator h8 = HeapAllocatorInitAligned(8);
HeapAllocator h16 = HeapAllocatorInitAligned(16);
HeapAllocator h32 = HeapAllocatorInitAligned(32);
HeapAllocator h64 = HeapAllocatorInitAligned(64);- In
Vec.Init.c:178:
HeapAllocator h16 = HeapAllocatorInitAligned(16);
HeapAllocator h32 = HeapAllocatorInitAligned(32);
HeapAllocator h64 = HeapAllocatorInitAligned(64);
h_default.base.retry_limit = 17;- In
Graph.Init.c:132:
alloc.base.retry_limit = 31;
HeapAllocator aligned_8 = HeapAllocatorInitAligned(8);
aligned_8.base.retry_limit = 31;
HeapAllocator aligned_16 = HeapAllocatorInitAligned(16);- In
Graph.Init.c:134:
HeapAllocator aligned_8 = HeapAllocatorInitAligned(8);
aligned_8.base.retry_limit = 31;
HeapAllocator aligned_16 = HeapAllocatorInitAligned(16);
aligned_16.base.retry_limit = 31;
HeapAllocator aligned_32 = HeapAllocatorInitAligned(32);- In
Graph.Init.c:136:
HeapAllocator aligned_16 = HeapAllocatorInitAligned(16);
aligned_16.base.retry_limit = 31;
HeapAllocator aligned_32 = HeapAllocatorInitAligned(32);
aligned_32.base.retry_limit = 31;
HeapAllocator aligned_64 = HeapAllocatorInitAligned(64);- In
Graph.Init.c:138:
HeapAllocator aligned_32 = HeapAllocatorInitAligned(32);
aligned_32.base.retry_limit = 31;
HeapAllocator aligned_64 = HeapAllocatorInitAligned(64);
aligned_64.base.retry_limit = 31;
Last updated on