summaryrefslogtreecommitdiffhomepage
path: root/FoundationEx/MemDebug.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'FoundationEx/MemDebug.cpp')
-rw-r--r--FoundationEx/MemDebug.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/FoundationEx/MemDebug.cpp b/FoundationEx/MemDebug.cpp
index 060df5a..3c71b2c 100644
--- a/FoundationEx/MemDebug.cpp
+++ b/FoundationEx/MemDebug.cpp
@@ -68,12 +68,12 @@ static HANDLE mem_log_file = 0;
#ifndef _DEBUG
void* __cdecl operator new(unsigned int s, const char*, int)
-{
+{
return ::operator new(s);
}
void __cdecl operator delete(void* p, const char*, int)
-{
+{
::operator delete(p);
}
@@ -95,7 +95,7 @@ void* __cdecl operator new[](unsigned int s, const char*, int)
}
void* __cdecl operator new(unsigned int s, const char*, int)
-{
+{
return ::operator new(s);
}
@@ -105,7 +105,7 @@ void __cdecl operator delete[](void* p, const char*, int)
}
void __cdecl operator delete(void* p, const char*, int)
-{
+{
::operator delete(p);
}
@@ -152,7 +152,7 @@ static void heapdump()
char report[256];
hinfo._pentry = NULL;
- while ((heapstatus = _heapwalk( &hinfo )) == _HEAPOK) {
+ while ((heapstatus = _heapwalk( &hinfo )) == _HEAPOK) {
sprintf_s(report, "%6s block at %Fp of size %4.4X\n",
( hinfo._useflag == _USEDENTRY ? "USED" : "FREE" ),
hinfo._pentry, hinfo._size);
@@ -198,7 +198,7 @@ Memory::OpenLog(const char* filename)
filename = "memdbg.txt";
mem_log_file = CreateFile(filename, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0);
-
+
if (mem_log_file) {
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
_CrtSetReportFile(_CRT_WARN, mem_log_file);
@@ -229,7 +229,7 @@ Memory::CloseLog()
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDOUT);
}
-#endif
+#endif
}
// +--------------------------------------------------------------------+
@@ -245,7 +245,7 @@ Memory::Check()
_asm { int 3 }
exit(1111);
}
-#endif
+#endif
}
// +--------------------------------------------------------------------+
@@ -263,9 +263,9 @@ Memory::Checkpoint()
_CrtMemCheckpoint(&mem_chk_p2);
_CrtMemDifference(&s, &mem_chk_p1, &mem_chk_p2);
_CrtMemDumpStatistics(&s);
-
+
memcpy(&mem_chk_p1, &mem_chk_p2, sizeof(mem_chk_p1));
-#endif
+#endif
}
// +--------------------------------------------------------------------+
@@ -282,7 +282,7 @@ Memory::Stats()
_CrtMemState s;
_CrtMemCheckpoint(&s);
_CrtMemDumpStatistics(&s);
-#endif
+#endif
}
// +--------------------------------------------------------------------+
@@ -294,7 +294,7 @@ Memory::DumpLeaks()
_RPT0(_CRT_WARN, "\n\nMemory Dump Leaks:\n"
"--------------------------------------------------\n");
_CrtDumpMemoryLeaks();
-#endif
+#endif
}
// +--------------------------------------------------------------------+
@@ -304,17 +304,17 @@ Memory::SetLevel(LEVEL l)
{
#ifdef _DEBUG
mem_chk_level = l;
-
+
_CrtSetDbgFlag(0);
-
+
switch (mem_chk_level) {
case MAXIMAL: CrtSetDebugField(_CRTDBG_CHECK_ALWAYS_DF);
case PERIODIC: CrtSetDebugField(_CRTDBG_DELAY_FREE_MEM_DF);
case LEAKS: CrtSetDebugField(_CRTDBG_LEAK_CHECK_DF);
- case OFF:
+ case OFF:
default: break;
}
-#endif
+#endif
}
#endif