Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Generals/Code/GameEngine/Source/Common/System/GameMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,7 @@ BlockCheckpointInfo *Checkpointable::debugAddCheckpointInfo(
{
#ifdef MEMORYPOOL_STACKTRACE
void **stacktrace = bi->getStacktraceInfo();
if (theStackTraceDepth > 0 && !TheGlobalData || TheGlobalData->m_checkForLeaks)
if (theStackTraceDepth > 0 && (!TheGlobalData || TheGlobalData->m_checkForLeaks))
{
memset(stacktrace, 0, MEMORYPOOL_STACKTRACE_SIZE_BYTES);
::FillStackAddresses(stacktrace, min(MEMORYPOOL_STACKTRACE_SIZE, theStackTraceDepth), MEMORYPOOL_STACKTRACE_SKIP_SIZE);
Expand Down Expand Up @@ -1584,7 +1584,8 @@ MemoryPoolBlob* MemoryPool::createBlob(Int allocationCount)
blob->addBlobToList(&m_firstBlob, &m_lastBlob);

DEBUG_ASSERTCRASH(m_firstBlobWithFreeBlocks == NULL, ("DO NOT IGNORE. Please call John McD - x36872 (m_firstBlobWithFreeBlocks != NULL)"));
m_firstBlobWithFreeBlocks = blob;
if (m_firstBlobWithFreeBlocks == NULL)
m_firstBlobWithFreeBlocks = blob;

// bookkeeping
m_totalBlocksInPool += allocationCount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,7 @@ BlockCheckpointInfo *Checkpointable::debugAddCheckpointInfo(
{
#ifdef MEMORYPOOL_STACKTRACE
void **stacktrace = bi->getStacktraceInfo();
if (theStackTraceDepth > 0 && !TheGlobalData || TheGlobalData->m_checkForLeaks)
if (theStackTraceDepth > 0 && (!TheGlobalData || TheGlobalData->m_checkForLeaks))
{
memset(stacktrace, 0, MEMORYPOOL_STACKTRACE_SIZE_BYTES);
::FillStackAddresses(stacktrace, min(MEMORYPOOL_STACKTRACE_SIZE, theStackTraceDepth), MEMORYPOOL_STACKTRACE_SKIP_SIZE);
Expand Down Expand Up @@ -1565,7 +1565,8 @@ MemoryPoolBlob* MemoryPool::createBlob(Int allocationCount)
blob->addBlobToList(&m_firstBlob, &m_lastBlob);

DEBUG_ASSERTCRASH(m_firstBlobWithFreeBlocks == nullptr, ("DO NOT IGNORE. Please call John McD - x36872 (m_firstBlobWithFreeBlocks != nullptr)"));
m_firstBlobWithFreeBlocks = blob;
if (m_firstBlobWithFreeBlocks == nullptr)
m_firstBlobWithFreeBlocks = blob;

// bookkeeping
m_totalBlocksInPool += allocationCount;
Expand Down
Loading