mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Fixed leak checking for >1 stack trace depth
This commit is contained in:
parent
a1c8d60d4b
commit
5cb6570e14
1 changed files with 4 additions and 4 deletions
|
@ -386,25 +386,25 @@ bf::System::Object* Internal::Dbg_ObjectAlloc(bf::System::ClassVData* classVData
|
|||
|
||||
intptr dbgAllocInfo;
|
||||
auto classVDataVal = (intptr)classVData | (intptr)BfObjectFlag_Allocated;
|
||||
result->mClassVData = classVDataVal;
|
||||
if (maxStackTraceDepth <= 1)
|
||||
dbgAllocInfo = (intptr)BF_RETURN_ADDRESS;
|
||||
else
|
||||
{
|
||||
if (largeAllocInfo)
|
||||
{
|
||||
result->mClassVData |= (intptr)BfObjectFlag_AllocInfo;
|
||||
classVDataVal |= (intptr)BfObjectFlag_AllocInfo;
|
||||
dbgAllocInfo = size;
|
||||
*(intptr*)((uint8*)result + size) = capturedTraceCount;
|
||||
memcpy((uint8*)result + size + sizeof(intptr), stackTrace, capturedTraceCount * sizeof(intptr));
|
||||
}
|
||||
else
|
||||
{
|
||||
result->mClassVData |= (intptr)BfObjectFlag_AllocInfo_Short;
|
||||
classVDataVal |= (intptr)BfObjectFlag_AllocInfo_Short;
|
||||
dbgAllocInfo = (size << 16) | capturedTraceCount;
|
||||
memcpy((uint8*)result + size, stackTrace, capturedTraceCount * sizeof(intptr));
|
||||
}
|
||||
}
|
||||
result->mClassVData = classVDataVal;
|
||||
BF_FULL_MEMORY_FENCE(); // Since we depend on mDbAllocInfo to determine if we are allocated, we need to set this last after we're set up
|
||||
result->mDbgAllocInfo = dbgAllocInfo;
|
||||
BF_FULL_MEMORY_FENCE();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue