Skip to content

Commit cee6a56

Browse files
committed
Use DEBUG_MEMORY_NAME where it's needed
DEBUG_MEMORY_NAME can be defined when USE_MEMORY_MONITOR or DEBUG is not
1 parent 9f22b38 commit cee6a56

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/Layers/xrRender/DetailManager.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,34 +96,34 @@ CDetailManager::CDetailManager() : xrc("detail manager")
9696
dm_cache_size = dm_current_cache_size;
9797
dm_fade = dm_current_fade;
9898
ps_r__Detail_density = ps_current_detail_density;
99-
#ifdef USE_MEMORY_MONITOR
99+
#ifdef DEBUG_MEMORY_NAME
100100
cache_level1 = (CacheSlot1**)Memory.mem_alloc(dm_cache1_line * sizeof(CacheSlot1*), "CDetailManager::cache_level1");
101101
#else
102102
cache_level1 = (CacheSlot1**)Memory.mem_alloc(dm_cache1_line * sizeof(CacheSlot1*));
103103
#endif
104104
for (u32 i = 0; i < dm_cache1_line; ++i)
105105
{
106-
#ifdef USE_MEMORY_MONITOR
106+
#ifdef DEBUG_MEMORY_NAME
107107
cache_level1[i] = (CacheSlot1*)Memory.mem_alloc(dm_cache1_line * sizeof(CacheSlot1), "CDetailManager::cache_level1 " + i);
108108
#else
109109
cache_level1[i] = (CacheSlot1*)Memory.mem_alloc(dm_cache1_line * sizeof(CacheSlot1));
110110
#endif
111111
for (u32 j = 0; j < dm_cache1_line; ++j)
112112
new(&cache_level1[i][j]) CacheSlot1();
113113
}
114-
#ifdef USE_MEMORY_MONITOR
114+
#ifdef DEBUG_MEMORY_NAME
115115
cache = (Slot***)Memory.mem_alloc(dm_cache_line * sizeof(Slot**), "CDetailManager::cache");
116116
#else
117117
cache = (Slot***)Memory.mem_alloc(dm_cache_line * sizeof(Slot**));
118118
#endif
119119
for (u32 i = 0; i < dm_cache_line; ++i)
120-
#ifdef USE_MEMORY_MONITOR
120+
#ifdef DEBUG_MEMORY_NAME
121121
cache[i] = (Slot**)Memory.mem_alloc(dm_cache_line * sizeof(Slot*), "CDetailManager::cache " + i);
122122
#else
123123
cache[i] = (Slot**)Memory.mem_alloc(dm_cache_line * sizeof(Slot*));
124124
#endif
125125

126-
#ifdef USE_MEMORY_MONITOR
126+
#ifdef DEBUG_MEMORY_NAME
127127
cache_pool = (Slot *)Memory.mem_alloc(dm_cache_size * sizeof(Slot), "CDetailManager::cache_pool");
128128
#else
129129
cache_pool = (Slot *)Memory.mem_alloc(dm_cache_size * sizeof(Slot));

src/xrScriptEngine/script_engine.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ static void* __cdecl luabind_allocator(void* context, const void* pointer, size_
115115
}
116116
if (!pointer)
117117
{
118-
#ifdef DEBUG
118+
#ifdef DEBUG_MEMORY_NAME
119119
return Memory.mem_alloc(size, "luabind");
120120
#else
121121
return Memory.mem_alloc(size);
122122
#endif
123123
}
124124
void* non_const_pointer = const_cast<LPVOID>(pointer);
125-
#ifdef DEBUG
125+
#ifdef DEBUG_MEMORY_NAME
126126
return Memory.mem_realloc(non_const_pointer, size, "luabind");
127127
#else
128128
return Memory.mem_realloc(non_const_pointer, size);

0 commit comments

Comments
 (0)