diff options
author | madmaxoft <github@xoft.cz> | 2013-12-27 11:51:08 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-12-27 11:51:08 +0100 |
commit | 1cf6502be23ff78e07a96b906738c97805120ca0 (patch) | |
tree | a3dad40d5fd0556b17e1b95ce80e67e6f24b6fe2 /src/LeakFinder.cpp | |
parent | Added proper precompiled headers for MSVC. (diff) | |
download | cuberite-1cf6502be23ff78e07a96b906738c97805120ca0.tar cuberite-1cf6502be23ff78e07a96b906738c97805120ca0.tar.gz cuberite-1cf6502be23ff78e07a96b906738c97805120ca0.tar.bz2 cuberite-1cf6502be23ff78e07a96b906738c97805120ca0.tar.lz cuberite-1cf6502be23ff78e07a96b906738c97805120ca0.tar.xz cuberite-1cf6502be23ff78e07a96b906738c97805120ca0.tar.zst cuberite-1cf6502be23ff78e07a96b906738c97805120ca0.zip |
Diffstat (limited to '')
-rw-r--r-- | src/LeakFinder.cpp | 18 |
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) |