Summary
PoolAllocator::Allocate() returns nullptr silently when the pool is exhausted. No assertion, no log, no diagnostic.
Location
ZEngine/ZEngine/Core/Memory/Allocator.cpp:237-249
void* PoolAllocator::Allocate()
{
PoolFreeNode* node = head;
if (node == nullptr)
return nullptr; // silent null — no assert, no log
...
}
Detail
Every other failure path in the allocator system uses ZENGINE_VALIDATE_ASSERT. A pool returning null on exhaustion is a capacity-planning failure — callers that skip the null check (e.g. ZPushDynamicArray macro users) will dereference null with no diagnostic.
ArenaAllocator::Resize asserts on OOM. PoolAllocator::Allocate should be consistent.
Fix
void* PoolAllocator::Allocate()
{
ZENGINE_VALIDATE_ASSERT(head != nullptr, "PoolAllocator::Allocate: pool exhausted — increase capacity at init");
PoolFreeNode* node = head;
head = head->Next;
Helpers::secure_memset(node, 0, chunk_size, chunk_size);
return node;
}
Impact
Medium — any caller that does not check the return value of ZPushDynamicArray / pool.Allocate() dereferences null silently in all build modes today.
Summary
PoolAllocator::Allocate()returnsnullptrsilently when the pool is exhausted. No assertion, no log, no diagnostic.Location
ZEngine/ZEngine/Core/Memory/Allocator.cpp:237-249Detail
Every other failure path in the allocator system uses
ZENGINE_VALIDATE_ASSERT. A pool returning null on exhaustion is a capacity-planning failure — callers that skip the null check (e.g.ZPushDynamicArraymacro users) will dereference null with no diagnostic.ArenaAllocator::Resizeasserts on OOM.PoolAllocator::Allocateshould be consistent.Fix
Impact
Medium — any caller that does not check the return value of
ZPushDynamicArray/pool.Allocate()dereferences null silently in all build modes today.