diff options
author | Tycho Bickerstaff <work.tycho@gmail.com> | 2013-12-22 14:19:27 +0100 |
---|---|---|
committer | Tycho Bickerstaff <work.tycho@gmail.com> | 2013-12-22 14:19:27 +0100 |
commit | 94ca07cfbfe0016d70963c055c87fe14f8622a4d (patch) | |
tree | 28dc91dc948287f802d9628a2ea715e1d4e0be49 /src/LeakFinder.cpp | |
parent | Chunk is now warnings clean (diff) | |
parent | Update GETTING-STARTED.md (diff) | |
download | cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.tar cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.tar.gz cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.tar.bz2 cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.tar.lz cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.tar.xz cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.tar.zst cuberite-94ca07cfbfe0016d70963c055c87fe14f8622a4d.zip |
Diffstat (limited to 'src/LeakFinder.cpp')
-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) |