1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-05 18:16:23 +03:00

0024908: Make OSD_MallocHook working under MSVS 2012

Additionally, insert a code in the inline method place_for_breakpoint in order to have any instruction in object code for placement of a break point.
This commit is contained in:
msv 2014-05-08 16:09:06 +04:00 committed by apv
parent 6d1dc3e82c
commit de9a2842e1

View File

@ -38,8 +38,13 @@ static OSD_MAllocHook::Callback* MypCurrentCallback = NULL;
namespace {
// dummy function to call at place where break point might be needed
inline void place_for_breakpoint () {}
}
static unsigned debug_counter = 0;
inline void place_for_breakpoint () {
// this statement is just to have any instruction in object code,
// otherwise compiler does not leave a place for break point
debug_counter++;
}
};
//=======================================================================
//function : GetCallback
@ -80,7 +85,7 @@ OSD_MAllocHook::CollectBySize* OSD_MAllocHook::GetCollectBySize()
#ifdef WNT
#include <crtdbg.h>
#if _MSC_VER == 1500 /* VS 2008 */
#if _MSC_VER >= 1500 /* VS 2008 */
static long getRequestNum(void* pvData, long lRequest, size_t& theSize)
{
@ -111,7 +116,7 @@ static long getRequestNum(void* pvData, long lRequest, size_t& theSize)
return aHeader->lRequest;
}
#else /* _MSC_VER == 1500 */
#else /* _MSC_VER < 1500 */
static long getRequestNum(void* /*pvData*/, long lRequest, size_t& /*theSize*/)
{