mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Tidy up and activate the MSVC Debug Heap
This commit is contained in:
@@ -20,35 +20,23 @@
|
||||
namespace Debug
|
||||
{
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
bool isDebuggerAttached ()
|
||||
{
|
||||
return beast_isRunningUnderDebugger ();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if BEAST_DEBUG && defined (beast_breakDebugger)
|
||||
void breakPoint ()
|
||||
{
|
||||
if (isDebuggerAttached ())
|
||||
#if BEAST_DEBUG
|
||||
if (beast_isRunningUnderDebugger ())
|
||||
beast_breakDebugger;
|
||||
}
|
||||
|
||||
#else
|
||||
void breakPoint ()
|
||||
{
|
||||
bassertfalse
|
||||
}
|
||||
bassertfalse;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if BEAST_MSVC && defined (_DEBUG)
|
||||
|
||||
void setHeapAlwaysCheck (bool bAlwaysCheck)
|
||||
void setAlwaysCheckHeap (bool bAlwaysCheck)
|
||||
{
|
||||
int flags = _CrtSetDbgFlag (_CRTDBG_REPORT_FLAG);
|
||||
|
||||
@@ -78,14 +66,21 @@ void setHeapReportLeaks (bool bReportLeaks)
|
||||
_CrtSetDbgFlag (flags);
|
||||
}
|
||||
|
||||
void reportLeaks ()
|
||||
{
|
||||
_CrtDumpMemoryLeaks ();
|
||||
}
|
||||
|
||||
void checkHeap ()
|
||||
{
|
||||
_CrtCheckMemory ();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#else
|
||||
|
||||
void setHeapAlwaysCheck (bool)
|
||||
void setAlwaysCheckHeap (bool)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -97,6 +92,10 @@ void setHeapReportLeaks (bool)
|
||||
{
|
||||
}
|
||||
|
||||
void reportLeaks ()
|
||||
{
|
||||
}
|
||||
|
||||
void checkHeap ()
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user