From 47f4beac5e8eed94eedd3d0b517a5330c963b0a5 Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Mon, 29 Apr 2024 23:33:08 +0800 Subject: [PATCH] feat remove static for __attribute__((constructor)) --- 3party/gperftools/src/base/googleinit.h | 2 +- 3party/gperftools/src/heap-profiler.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/3party/gperftools/src/base/googleinit.h b/3party/gperftools/src/base/googleinit.h index fcbd253..d66971e 100644 --- a/3party/gperftools/src/base/googleinit.h +++ b/3party/gperftools/src/base/googleinit.h @@ -63,7 +63,7 @@ private: namespace { \ static void google_init_module_##name() { body; } \ GoogleInitializer google_initializer_module_##name(#name, google_init_module_##name, NULL); \ - __attribute__((constructor)) static void EnsureConstructorRunsBeforeMain() \ + __attribute__((constructor)) void EnsureConstructorRunsBeforeMain() \ { \ google_initializer_module_##name.module_name(); \ } \ diff --git a/3party/gperftools/src/heap-profiler.cc b/3party/gperftools/src/heap-profiler.cc index 49e9cd7..8733f8c 100644 --- a/3party/gperftools/src/heap-profiler.cc +++ b/3party/gperftools/src/heap-profiler.cc @@ -423,7 +423,7 @@ LogMappingEvent(const tcmalloc::MappingEvent &evt) extern "C" void HeapProfilerStart(const char *prefix) { - SpinLockHolder l(&heap_lock); + SpinLockHolder lock(&heap_lock); if (is_on) return;