From: Paul Floyd Date: Sat, 4 Nov 2023 15:35:05 +0000 (+0100) Subject: massif regtest: keep churning with overloaded-new test X-Git-Tag: VALGRIND_3_23_0~295 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d4e49148a5be8babdd428997a992c3d5d544222;p=thirdparty%2Fvalgrind.git massif regtest: keep churning with overloaded-new test Solaris 11.3 doesn't have aligned_alloc so remove it. In any case I think it's better to use dummy allocators since that means there is no risk of accidentally falling through to malloc/free. --- diff --git a/massif/tests/overloaded-new.cpp b/massif/tests/overloaded-new.cpp index c531ca8830..5ad92894e9 100644 --- a/massif/tests/overloaded-new.cpp +++ b/massif/tests/overloaded-new.cpp @@ -16,62 +16,62 @@ typedef struct { __attribute__((noinline)) void* operator new (std::size_t n) { - return malloc(n); + return (void*)12345; } __attribute__((noinline)) void* operator new (std::size_t n, std::nothrow_t const &) { - return malloc(n); + return (void*)23456; } __attribute__((noinline)) void* operator new[] (std::size_t n) { - return malloc(n); + return (void*)34567; } __attribute__((noinline)) void* operator new[] (std::size_t n, std::nothrow_t const &) { - return malloc(n); + return (void*)45678; } __attribute__((noinline)) void* operator new (std::size_t size, std::align_val_t al) { - return aligned_alloc(static_cast(al), size); + return (void*)56789; } __attribute__((noinline)) void* operator new[] (std::size_t size, std::align_val_t al) { - return aligned_alloc(static_cast(al), size); + return (void*)67890; } __attribute__((noinline)) void* operator new(std::size_t size, std::align_val_t al, const std::nothrow_t&) noexcept { - return aligned_alloc(static_cast(al), size); + return (void*)78901; } __attribute__((noinline)) void* operator new[](std::size_t size, std::align_val_t al, const std::nothrow_t&) noexcept { - return aligned_alloc(static_cast(al), size); + return (void*)89012; } __attribute__((noinline)) void operator delete (void* p) { - free(p); + } __attribute__((noinline)) void operator delete[] (void* p) { - free(p); + } __attribute__((noinline)) void operator delete (void* ptr, std::align_val_t al ) noexcept { - free(ptr); + } __attribute__((noinline)) void operator delete[] (void* ptr, std::align_val_t al ) noexcept { - free(ptr); + } int main(void)