Skip to content

Commit 6a92373

Browse files
committed
game now boots
1 parent 19fe4f3 commit 6a92373

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Core/GameEngine/Source/Common/System/GameMemory.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2657,7 +2657,7 @@ MemoryPool *MemoryPoolFactory::createMemoryPool(const char *poolName, Int alloca
26572657

26582658
userMemoryAdjustPoolSize(poolName, initialAllocationCount, overflowAllocationCount);
26592659

2660-
if (initialAllocationCount <= 0 || overflowAllocationCount < 0)
2660+
if (initialAllocationCount < 0 || overflowAllocationCount < 0 || (initialAllocationCount == 0 && overflowAllocationCount == 0))
26612661
{
26622662
DEBUG_CRASH(("illegal pool size: %d %d",initialAllocationCount,overflowAllocationCount));
26632663
throw ERROR_OUT_OF_MEMORY;
@@ -3550,7 +3550,9 @@ void* createW3DMemPool(const char *poolName, int allocationSize)
35503550
{
35513551
++theLinkTester;
35523552
preMainInitMemoryManager();
3553-
MemoryPool* pool = TheMemoryPoolFactory->createMemoryPool(poolName, allocationSize, 0, 0);
3553+
// Use 1 initial block and allow growth (32 overflow) to avoid validation failure
3554+
// and ensure the pool is actually usable.
3555+
MemoryPool* pool = TheMemoryPoolFactory->createMemoryPool(poolName, allocationSize, 1, 32);
35543556
DEBUG_ASSERTCRASH(pool && pool->getAllocationSize() == allocationSize, ("bad w3d pool"));
35553557
return pool;
35563558
}

0 commit comments

Comments
 (0)