Compare commits

...

2 commits

Author SHA1 Message Date
Eduard Voronkin
9968e6e7a7
Merge fd5ab9f1f3 into f2539bbe34 2025-03-28 17:41:11 -07:00
Eduard Voronkin
fd5ab9f1f3 fix new/delete overrides
apparently, even if MI_USE_CXX is OFF, mimalloc still provides mangled definitions of new/delete operators. It causes inability to statically link mimaloc in our scenario, since we want to have our own overrides of new/delete functions.
2024-11-06 12:02:22 -08:00

View file

@ -189,7 +189,6 @@ typedef void* mi_nothrow_t;
void* operator new[]( std::size_t n, std::align_val_t al) noexcept(false) { return mi_new_aligned(n, static_cast<size_t>(al)); }
void* operator new (std::size_t n, std::align_val_t al, const std::nothrow_t&) noexcept { return mi_new_aligned_nothrow(n, static_cast<size_t>(al)); }
void* operator new[](std::size_t n, std::align_val_t al, const std::nothrow_t&) noexcept { return mi_new_aligned_nothrow(n, static_cast<size_t>(al)); }
#endif
#elif (defined(__GNUC__) || defined(__clang__))
// ------------------------------------------------------
@ -234,6 +233,7 @@ typedef void* mi_nothrow_t;
#else
#error "define overloads for new/delete for this platform (just for performance, can be skipped)"
#endif
#endif
#endif // __cplusplus
// ------------------------------------------------------