aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/memory/memory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zencore/memory/memory.cpp')
-rw-r--r--src/zencore/memory/memory.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/zencore/memory/memory.cpp b/src/zencore/memory/memory.cpp
index ae1b9abce..fced2a4d3 100644
--- a/src/zencore/memory/memory.cpp
+++ b/src/zencore/memory/memory.cpp
@@ -284,3 +284,29 @@ zen_free_aligned(void* Ptr, size_t Alignment) noexcept
ZEN_UNUSED(Alignment);
zen::Memory::Free(Ptr);
}
+
+// EASTL operator new
+
+void*
+operator new[](size_t size, const char* pName, int flags, unsigned debugFlags, const char* file, int line)
+{
+ ZEN_UNUSED(pName, flags, debugFlags, file, line);
+ return zen_new(size);
+}
+
+void*
+operator new[](size_t size,
+ size_t alignment,
+ size_t alignmentOffset,
+ const char* pName,
+ int flags,
+ unsigned debugFlags,
+ const char* file,
+ int line)
+{
+ ZEN_UNUSED(alignmentOffset, pName, flags, debugFlags, file, line);
+
+ ZEN_ASSERT_SLOW(alignmentOffset == 0); // currently not supported
+
+ return zen_new_aligned(size, alignment);
+}