AllocatorAlignment
Description
Power-of-two alignment (in bytes) that the allocator promises for every region it hands out. Set at *AllocatorInit time and never mutated – the validator asserts it stays a power of two greater than zero. Containers consult this to size their per-element stride (Vec rounds sizeof(T) up to the allocator’s alignment so element pointers stay aligned even when the type’s natural alignment is smaller). Same ((void)0, ...) accessor shape as the stats; ALLOCATOR_OF performs the typed -> base cast via _Generic without dispatching, so the macro compiles down to a direct field load. No function call, no vtable.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Init.h:85:
.length = VecLen(&(v)), \
.pos = 0, \
.alignment = VecAllocator(&(v)) ? AllocatorAlignment(VecAllocator(&(v))) : 1, \
.dir = 1}- In
Init.h:104:
.length = VecLen(&(v)), \
.pos = 0, \
.alignment = VecAllocator(&(v)) ? AllocatorAlignment(VecAllocator(&(v))) : 1, \
.dir = -1}- In
Init.h:183:
.length = VecLen(&(v)), \
.pos = 0, \
.alignment = VecAllocator(&(v)) ? AllocatorAlignment(VecAllocator(&(v))) : 1, \
.dir = 1})- In
Init.h:203:
.length = VecLen(&(v)), \
.pos = 0, \
.alignment = VecAllocator(&(v)) ? AllocatorAlignment(VecAllocator(&(v))) : 1, \
.dir = -1})
Last updated on