summaryrefslogtreecommitdiffstats
path: root/src/LeakFinder.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2013-12-27 13:54:42 +0100
committerMattes D <github@xoft.cz>2013-12-27 13:54:42 +0100
commit194a1b208ff91fed07bfd3e38d9593d3ac9b7ac6 (patch)
tree65a4af510bf272fc302c40dd5e2b7c8302520e0c /src/LeakFinder.cpp
parentMerge pull request #476 from mc-server/apidump-writingplugin (diff)
parentLua is built statically on *nix. (diff)
downloadcuberite-194a1b208ff91fed07bfd3e38d9593d3ac9b7ac6.tar
cuberite-194a1b208ff91fed07bfd3e38d9593d3ac9b7ac6.tar.gz
cuberite-194a1b208ff91fed07bfd3e38d9593d3ac9b7ac6.tar.bz2
cuberite-194a1b208ff91fed07bfd3e38d9593d3ac9b7ac6.tar.lz
cuberite-194a1b208ff91fed07bfd3e38d9593d3ac9b7ac6.tar.xz
cuberite-194a1b208ff91fed07bfd3e38d9593d3ac9b7ac6.tar.zst
cuberite-194a1b208ff91fed07bfd3e38d9593d3ac9b7ac6.zip
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)