From fa27cf49842fb8418ed1dbe2e7e3d006c86a16e8 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Sat, 4 Oct 2025 18:18:46 +0200 Subject: fix link error with operator new (#553) --- src/zencore/memory/memory.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/zencore/memory/memory.cpp') 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); +} -- cgit v1.2.3