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.
This commit is contained in:
Aliaksey Kandratsenka 2024-02-22 18:10:10 -05:00
parent de3066fb1f
commit 9381dd0b19

View File

@ -606,7 +606,7 @@ static void TestHugeAllocations(AllocatorState* rnd) {
}
static void TestCalloc(size_t n, size_t s, bool ok) {
char* p = reinterpret_cast<char*>(calloc(n, s));
char* p = reinterpret_cast<char*>(noopt(calloc)(n, s));
if (FLAGS_verbose)
fprintf(LOGSTREAM, "calloc(%zx, %zx): %p\n", n, s, p);
if (!ok) {