diff options
| author | Stefan Boberg <[email protected]> | 2025-10-04 18:18:46 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-10-04 18:18:46 +0200 |
| commit | fa27cf49842fb8418ed1dbe2e7e3d006c86a16e8 (patch) | |
| tree | 1ed04664f11028624778ca8f1f1ed59916539e11 /src/zencore/memory/memory.cpp | |
| parent | 5.7.5 (diff) | |
| download | zen-fa27cf49842fb8418ed1dbe2e7e3d006c86a16e8.tar.xz zen-fa27cf49842fb8418ed1dbe2e7e3d006c86a16e8.zip | |
fix link error with operator new (#553)
Diffstat (limited to 'src/zencore/memory/memory.cpp')
| -rw-r--r-- | src/zencore/memory/memory.cpp | 26 |
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); +} |