From d5bd0087c1ff51a73faa6cc03ad726ace2eedcf7 Mon Sep 17 00:00:00 2001 From: Aliaksey Kandratsenka Date: Wed, 20 Mar 2024 19:37:31 -0400 Subject: [PATCH] avoid VLOG dependency in heap-profiler test This makes the test compatible with -fvisibility=hidden --- src/tests/heap-profiler_unittest.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tests/heap-profiler_unittest.cc b/src/tests/heap-profiler_unittest.cc index 04d1b47..cad1458 100644 --- a/src/tests/heap-profiler_unittest.cc +++ b/src/tests/heap-profiler_unittest.cc @@ -59,10 +59,12 @@ static const int kMaxCount = 100000; int* g_array[kMaxCount]; // an array of int-vectors +static const char* volatile marker; + static ATTRIBUTE_NOINLINE void Allocate(int start, int end, int size) { // NOTE: we're using this to prevent gcc 5 from merging otherwise // identical Allocate & Allocate2 functions. - VLOG(10, "Allocate"); + marker = "Allocate"; for (int i = start; i < end; ++i) { if (i < kMaxCount) g_array[i] = new int[size]; @@ -70,7 +72,7 @@ static ATTRIBUTE_NOINLINE void Allocate(int start, int end, int size) { } static ATTRIBUTE_NOINLINE void Allocate2(int start, int end, int size) { - VLOG(10, "Allocate2"); + marker = "Allocate2"; for (int i = start; i < end; ++i) { if (i < kMaxCount) g_array[i] = new int[size];