From 87579e39fd55121385bf88f2a32d9f5010ca270a Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Mon, 11 Jul 2022 12:45:06 -0700 Subject: [PATCH] Add C++14 sized deallocation --- test/test_mixed_move_cpp_int.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/test_mixed_move_cpp_int.cpp b/test/test_mixed_move_cpp_int.cpp index 526e5a72..fa25cace 100644 --- a/test/test_mixed_move_cpp_int.cpp +++ b/test/test_mixed_move_cpp_int.cpp @@ -37,14 +37,23 @@ void* operator new[](std::size_t count) ++alloc_count; return std::malloc(count); } -void operator delete(void * p)noexcept +void operator delete(void* p)noexcept { return std::free(p); } +void operator delete(void* p, std::size_t) +{ + return ::operator delete(p); +} void operator delete[](void* p)noexcept { return std::free(p); } +void operator delete[](void* p, std::size_t) +{ + return ::operator delete[](p); +} + template @@ -204,8 +213,8 @@ int main() { using namespace boost::multiprecision; // - // Our "From" type has the MinBits argument as small as possible, - // should it be larger than the default used in cpp_int then we + // Our "From" type has the MinBits argument as small as possible, + // should it be larger than the default used in cpp_int then we // may get allocations causing the tests above to fail since the // internal cache in type From is larger than that of cpp_int and so // allocation may be needed even on a move.