summaryrefslogtreecommitdiffstats
path: root/src/LeakFinder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/LeakFinder.cpp')
-rw-r--r--src/LeakFinder.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/LeakFinder.cpp b/src/LeakFinder.cpp
index 0f84adb2b..9d7f185ba 100644
--- a/src/LeakFinder.cpp
+++ b/src/LeakFinder.cpp
@@ -95,15 +95,11 @@
*
**********************************************************************/
-#include <windows.h>
-#include <objidl.h> // Needed if compiled with "WIN32_LEAN_AND_MEAN"
+#include "Globals.h"
+
#include <tchar.h>
+#include <objidl.h> // Needed if compiled with "WIN32_LEAN_AND_MEAN"
#include <crtdbg.h>
-#include <stdio.h>
-
-#include <string>
-#include <vector>
-
#include "LeakFinder.h"
@@ -463,11 +459,11 @@ public:
pHashEntry->nDataSize = nDataSize;
pHashEntry->Next = NULL;
#ifdef _M_IX86
- pHashEntry->pCallstackOffset = (LPVOID) min(context.Ebp, context.Esp);
+ pHashEntry->pCallstackOffset = (LPVOID) std::min(context.Ebp, context.Esp);
#elif _M_X64
- pHashEntry->pCallstackOffset = (LPVOID) min(context.Rdi, context.Rsp);
+ pHashEntry->pCallstackOffset = (LPVOID) std::min(context.Rdi, context.Rsp);
#elif _M_IA64
- pHashEntry->pCallstackOffset = (LPVOID) min(context.IntSp, context.RsBSP);
+ pHashEntry->pCallstackOffset = (LPVOID) std::min(context.IntSp, context.RsBSP);
#else
#error "Platform not supported!"
#endif
@@ -490,7 +486,7 @@ public:
if (pHashEntry->nMaxStackSize > 0)
{
SIZE_T len = ((SIZE_T) pHashEntry->pStackBaseAddr + pHashEntry->nMaxStackSize) - (SIZE_T)pHashEntry->pCallstackOffset;
- bytesToRead = min(len, MAX_CALLSTACK_LEN_BUF);
+ bytesToRead = std::min(len, (SIZE_T)MAX_CALLSTACK_LEN_BUF);
}
// Now read the callstack:
if (ReadProcessMemory(GetCurrentProcess(), (LPCVOID) pHashEntry->pCallstackOffset, &(pHashEntry->pcCallstackAddr), bytesToRead, &(pHashEntry->nCallstackLen)) == 0)