From 9381dd0b190c2603b1ed5d963946948ec38f38f8 Mon Sep 17 00:00:00 2001 From: Aliaksey Kandratsenka Date: Thu, 22 Feb 2024 18:10:10 -0500 Subject: [PATCH] tcmalloc_unittest: wrap calloc reference with noopt It is not clear why we didn't hit this before, but in some cases we see calloc being optimized away (just like we had with new/malloc). And noopt is how we deal with it. --- src/tests/tcmalloc_unittest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/tcmalloc_unittest.cc b/src/tests/tcmalloc_unittest.cc index 8294793..d25439c 100644 --- a/src/tests/tcmalloc_unittest.cc +++ b/src/tests/tcmalloc_unittest.cc @@ -606,7 +606,7 @@ static void TestHugeAllocations(AllocatorState* rnd) { } static void TestCalloc(size_t n, size_t s, bool ok) { - char* p = reinterpret_cast(calloc(n, s)); + char* p = reinterpret_cast(noopt(calloc)(n, s)); if (FLAGS_verbose) fprintf(LOGSTREAM, "calloc(%zx, %zx): %p\n", n, s, p); if (!ok) {