summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/LeakFinder.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/LeakFinder.cpp b/source/LeakFinder.cpp
index df4aff613..6439ff331 100644
--- a/source/LeakFinder.cpp
+++ b/source/LeakFinder.cpp
@@ -393,8 +393,8 @@ protected:
virtual LONG Disable() = 0;
// enables the leak-finder again...
virtual LONG Enable() = 0;
-
-private:
+
+protected:
// Entry for each allocation
typedef struct AllocHashEntryType {
HASHTABLE_KEY key;
@@ -678,6 +678,9 @@ static LONG s_CrtDisableCount = 0;
static LONG s_lMallocCalled = 0;
+
+
+
class CRTTable : public ContextHashtableBase<LONG>
{
public:
@@ -725,6 +728,8 @@ public:
#endif
}
+ static const int AllocHashEntryTypeSize = sizeof(AllocHashEntryType);
+
protected:
CHAR *m_pBuffer;
SIZE_T m_maxBufferLen;
@@ -885,9 +890,9 @@ static int MyAllocHook(int nAllocType, void *pvData,
{
if (lRequest != 0) // Always a valid RequestID should be provided (see comments in the header)
{
- g_CurrentMemUsage += nSize;
+ g_CurrentMemUsage += nSize + CRTTable::AllocHashEntryTypeSize;
- if (g_CurrentMemUsage > 65970823)//1024 * 1024 * 1024)
+ if (g_CurrentMemUsage > 1024 * 1024 * 1024)
{
printf("******************************************\n");
printf("** Server reached 1 GiB memory usage, **\n");