diff --git a/test/secp256k1_allocation_test.cpp b/test/secp256k1_allocation_test.cpp index 1660310f..9a760e48 100644 --- a/test/secp256k1_allocation_test.cpp +++ b/test/secp256k1_allocation_test.cpp @@ -68,9 +68,10 @@ class counting_resource final : public std::pmr::memory_resource { int main() { std::cout << "the C library's allocations counted: " << webcpp::test::c_allocations_counted << "\n"; - // The control: one operator new moves the counter. + // The control: one operator new moves the counter. A call of the function, not a + // new-expression, whose allocation the optimizer may elide ([expr.new]), as -O3 does. std::size_t const control = webcpp::test::allocations(); - delete new int(1); // NOLINT(cppcoreguidelines-owning-memory): the control's allocation + ::operator delete(::operator new(sizeof(int))); BOOST_TEST(webcpp::test::allocations() > control); counting_resource resource;