ValidateAllocator
Description
Validate an allocator base. Aborts via LOG_FATAL when the allocator is structurally invalid (NULL pointer, missing fn pointers, alignment is zero or not a power of two).
Parameters
| Name | Direction | Description |
|---|---|---|
self |
in | Allocator base to validate. |
Success
Function returns. The allocator is structurally valid.
Failure
Does not return - aborts via LOG_FATAL / SysAbort.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Allocator.c:32:
}
void ValidateAllocator(const Allocator *self) {
if (!self) {
LOG_FATAL("NULL allocator pointer");- In
Allocator.c:48:
void *AllocatorAlloc(Allocator *self, size bytes, i8 zeroed) {
ValidateAllocator(self);
size attempts = allocator_attempt_limit(self);- In
Allocator.c:62:
void *AllocatorRealloc(Allocator *self, void *ptr, size old_size, size new_size) {
ValidateAllocator(self);
size attempts = allocator_attempt_limit(self);- In
Allocator.c:79:
return;
}
ValidateAllocator(self);
self->deallocate(self, ptr, bytes);
}
Last updated on