summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/static_vars.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/static_vars.cc b/src/static_vars.cc
index e71a044..cb42c37 100644
--- a/src/static_vars.cc
+++ b/src/static_vars.cc
@@ -36,6 +36,7 @@
#include "internal_logging.h" // for CHECK_CONDITION
#include "common.h"
#include "sampler.h" // for Sampler
+#include "base/googleinit.h"
namespace tcmalloc {
@@ -95,7 +96,6 @@ void Static::InitStaticVars() {
for (int i = 0; i < kNumClasses; ++i) {
central_cache_[i].Init(i);
}
- SetupAtForkLocksHandler();
// It's important to have PageHeap allocated, not in static storage,
// so that HeapLeakChecker does not consider all the byte patterns stored
@@ -106,4 +106,6 @@ void Static::InitStaticVars() {
Sampler::InitStatics();
}
+REGISTER_MODULE_INITIALIZER(tcmalloc_fork_handler, SetupAtForkLocksHandler());
+
} // namespace tcmalloc