Skip to content

Commit f8e507b

Browse files
committed
Remove memory monitor
1 parent 508755e commit f8e507b

File tree

6 files changed

+0
-219
lines changed

6 files changed

+0
-219
lines changed

src/xrCore/memory_monitor.cpp

Lines changed: 0 additions & 160 deletions
This file was deleted.

src/xrCore/memory_monitor.h

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/xrCore/xrCore.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD ul_reason_for_call, LPVOID lpvRese
228228
break;
229229
case DLL_THREAD_DETACH: break;
230230
case DLL_PROCESS_DETACH:
231-
#ifdef USE_MEMORY_MONITOR
232-
memory_monitor::flush_each_time(true);
233-
#endif // USE_MEMORY_MONITOR
234231
break;
235232
}
236233
return TRUE;

src/xrCore/xrDebug.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,6 @@ void xrDebug::GatherInfo(char* assertionInfo, const ErrorLocation& loc, const ch
164164
FlushLog();
165165
}
166166
buffer = assertionInfo;
167-
#ifdef USE_MEMORY_MONITOR
168-
memory_monitor::flush_each_time(true);
169-
memory_monitor::flush_each_time(false);
170-
#endif // USE_MEMORY_MONITOR
171167
if (IsDebuggerPresent() || !strstr(GetCommandLine(), "-no_call_stack_assert"))
172168
return;
173169
if (shared_str_initialized)

src/xrCore/xrMemory.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
#pragma once
22

33
#include "Memory/memory_allocator_options.h"
4-
#include "memory_monitor.h"
5-
6-
#ifdef USE_MEMORY_MONITOR
7-
#define DEBUG_MEMORY_NAME
8-
#endif // USE_MEMORY_MONITOR
94

105
#ifndef M_BORLAND
116
#if 0 // def DEBUG

src/xrCore/xrMemory_subst_msvc.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ extern void save_stack_trace();
1212

1313
MEMPOOL mem_pools[mem_pools_count];
1414

15-
constexpr pcstr _name = "_noname_";
16-
1715
// MSVC
1816
ICF u8* acc_header(void* P) { return (u8*)P - 1; }
1917
ICF u32 get_header(void* P) { return (u32)*acc_header(P); }
@@ -41,9 +39,6 @@ void* xrMemory::mem_alloc(size_t size)
4139
if (g_use_pure_alloc)
4240
{
4341
void* result = malloc(size);
44-
#if defined(USE_MEMORY_MONITOR) && defined(DEBUG_MEMORY_NAME)
45-
memory_monitor::monitor_alloc(result, size, _name);
46-
#endif
4742
return result;
4843
}
4944
#ifdef DEBUG_MEMORY_MANAGER
@@ -87,19 +82,13 @@ void* xrMemory::mem_alloc(size_t size)
8782
dbg_register(_ptr, size, _name);
8883
if (mem_initialized)
8984
debug_cs.Leave();
90-
#endif
91-
#if defined(USE_MEMORY_MONITOR) && defined(DEBUG_MEMORY_NAME)
92-
memory_monitor::monitor_alloc(_ptr, size, _name);
9385
#endif
9486
return _ptr;
9587
}
9688

9789
void xrMemory::mem_free(void* P)
9890
{
9991
stat_calls++;
100-
#ifdef USE_MEMORY_MONITOR
101-
memory_monitor::monitor_free(P);
102-
#endif
10392
if (g_use_pure_alloc)
10493
{
10594
free(P);
@@ -140,10 +129,6 @@ void* xrMemory::mem_realloc(void* P, size_t size)
140129
if (g_use_pure_alloc)
141130
{
142131
void* result = realloc(P, size);
143-
#ifdef USE_MEMORY_MONITOR
144-
memory_monitor::monitor_free(P);
145-
memory_monitor::monitor_alloc(result, size, _name);
146-
#endif
147132
return result;
148133
}
149134
if (!P)
@@ -187,10 +172,6 @@ void* xrMemory::mem_realloc(void* P, size_t size)
187172
#ifdef DEBUG_MEMORY_MANAGER
188173
if (debug_mode)
189174
dbg_register(_ptr, size, _name);
190-
#endif
191-
#ifdef USE_MEMORY_MONITOR
192-
memory_monitor::monitor_free(P);
193-
memory_monitor::monitor_alloc(_ptr, size, _name);
194175
#endif
195176
}
196177
else if (p_mode == 1)

0 commit comments

Comments
 (0)