summaryrefslogtreecommitdiffstats
path: root/src/AllocationPool.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/AllocationPool.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/AllocationPool.h b/src/AllocationPool.h
index b8fae4a95..d1769dc03 100644
--- a/src/AllocationPool.h
+++ b/src/AllocationPool.h
@@ -81,7 +81,19 @@ public:
void * space = malloc(sizeof(T));
if (space != nullptr)
{
+ #if defined(_MSC_VER) && defined(_DEBUG)
+ // The debugging-new that is set up using macros in Globals.h doesn't support the placement-new syntax used here.
+ // Temporarily disable the macro
+ #pragma push_macro("new")
+ #undef new
+ #endif
+
return new(space) T;
+
+ #if defined(_MSC_VER) && defined(_DEBUG)
+ // Re-enable the debugging-new macro
+ #pragma pop_macro("new")
+ #endif
}
else if (m_FreeList.size() == NumElementsInReserve)
{
@@ -95,7 +107,21 @@ public:
}
}
// placement new, used to initalize the object
+
+ #if defined(_MSC_VER) && defined(_DEBUG)
+ // The debugging-new that is set up using macros in Globals.h doesn't support the placement-new syntax used here.
+ // Temporarily disable the macro
+ #pragma push_macro("new")
+ #undef new
+ #endif
+
T * ret = new (m_FreeList.front()) T;
+
+ #if defined(_MSC_VER) && defined(_DEBUG)
+ // Re-enable the debugging-new macro
+ #pragma pop_macro("new")
+ #endif
+
m_FreeList.pop_front();
return ret;
}