diff --git a/test/unordered/deduction_tests.cpp b/test/unordered/deduction_tests.cpp index 571aa7fa..7d3996e3 100644 --- a/test/unordered/deduction_tests.cpp +++ b/test/unordered/deduction_tests.cpp @@ -35,8 +35,8 @@ template struct test_allocator typedef T value_type; test_allocator() = default; template test_allocator(test_allocator const&) {} - T* allocate(std::size_t n) const { return (T*)malloc(sizeof(T) * n); } - void deallocate(T* ptr, std::size_t) const { free(ptr); } + T* allocate(std::size_t n) const { return (T*)(::operator new(sizeof(T) * n)); } + void deallocate(T* ptr, std::size_t) const { ::operator delete(ptr); } bool operator==(test_allocator const&) const { return true; } bool operator!=(test_allocator const&) const { return false; } }; diff --git a/test/unordered/reserve_tests.cpp b/test/unordered/reserve_tests.cpp index 29b4b5b0..7ef0c5c4 100644 --- a/test/unordered/reserve_tests.cpp +++ b/test/unordered/reserve_tests.cpp @@ -30,13 +30,13 @@ template struct A { total_allocation += n * sizeof(T); ++num_allocations; - return (T*)std::calloc(n, sizeof(T)); + return (T*)(::operator new(n * sizeof(T))); } void deallocate(T* p, std::size_t n) noexcept { total_allocation -= n * sizeof(T); - std::free(p); + ::operator delete(p); } bool operator==(A const& a) const { return i == a.i; }