From 4716ff5b92c9a2ce02fc422e36ca6274b0cf5701 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Fri, 5 Oct 2018 02:22:17 -0400 Subject: [PATCH] explicitly export C++ allocator overrides This doesn't make any difference for GCC, but these aren't replaced outside of the library with Clang without explicitly exporting them. --- new.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/new.cc b/new.cc index 2dff7da..f3554df 100644 --- a/new.cc +++ b/new.cc @@ -41,42 +41,42 @@ static inline void *new_impl(size_t size, bool nothrow) { return handle_out_of_memory(size, nothrow); } -void *operator new(size_t size) { +EXPORT void *operator new(size_t size) { return new_impl(size, false); } -void *operator new[](size_t size) { +EXPORT void *operator new[](size_t size) { return new_impl(size, false); } -void *operator new(size_t size, const std::nothrow_t &) noexcept { +EXPORT void *operator new(size_t size, const std::nothrow_t &) noexcept { return new_impl(size, true); } -void *operator new[](size_t size, const std::nothrow_t &) noexcept { +EXPORT void *operator new[](size_t size, const std::nothrow_t &) noexcept { return new_impl(size, true); } -void operator delete(void *ptr) noexcept { +EXPORT void operator delete(void *ptr) noexcept { h_free(ptr); } -void operator delete[](void *ptr) noexcept { +EXPORT void operator delete[](void *ptr) noexcept { h_free(ptr); } -void operator delete(void *ptr, const std::nothrow_t &) noexcept { +EXPORT void operator delete(void *ptr, const std::nothrow_t &) noexcept { h_free(ptr); } -void operator delete[](void *ptr, const std::nothrow_t &) noexcept { +EXPORT void operator delete[](void *ptr, const std::nothrow_t &) noexcept { h_free(ptr); } -void operator delete(void *ptr, size_t size) noexcept { +EXPORT void operator delete(void *ptr, size_t size) noexcept { h_free_sized(ptr, size); } -void operator delete[](void *ptr, size_t size) noexcept { +EXPORT void operator delete[](void *ptr, size_t size) noexcept { h_free_sized(ptr, size); }