LeakFinder: Fixed previous commit, housekeeping is now factored in properly in both "alloc" and "free".
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1311 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
398edefe06
commit
9eff51d831
@ -847,7 +847,7 @@ static int MyAllocHook(int nAllocType, void *pvData,
|
|||||||
if (lRequest != 0)
|
if (lRequest != 0)
|
||||||
{
|
{
|
||||||
// RequestID was found
|
// RequestID was found
|
||||||
g_CurrentMemUsage -= nSize;
|
g_CurrentMemUsage -= nSize + CRTTable::AllocHashEntryTypeSize;
|
||||||
g_pCRTTable->Remove(lRequest);
|
g_pCRTTable->Remove(lRequest);
|
||||||
}
|
}
|
||||||
} // freeing
|
} // freeing
|
||||||
@ -865,7 +865,7 @@ static int MyAllocHook(int nAllocType, void *pvData,
|
|||||||
pHead = pHdr(pvData);
|
pHead = pHdr(pvData);
|
||||||
// Try to find the RequestID in the Hash-Table, mark it that it was freed
|
// Try to find the RequestID in the Hash-Table, mark it that it was freed
|
||||||
lReallocRequest = pHead->lRequest;
|
lReallocRequest = pHead->lRequest;
|
||||||
g_CurrentMemUsage -= pHead->nDataSize;
|
g_CurrentMemUsage -= pHead->nDataSize + CRTTable::AllocHashEntryTypeSize;
|
||||||
bRet = g_pCRTTable->Remove(lReallocRequest);
|
bRet = g_pCRTTable->Remove(lReallocRequest);
|
||||||
} // ValidHeapPointer
|
} // ValidHeapPointer
|
||||||
} // re-allocating
|
} // re-allocating
|
||||||
|
Loading…
Reference in New Issue
Block a user