summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-06-03 07:50:56 -0500
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-06-03 07:50:56 -0500
commit81d99f21ede78ab8d5fec15d0055416ac1b581f3 (patch)
treed69fb265d5e98aab9c669618d845c91b49e5ef77
parent846b775dfadb77901202ae7ddbac30ad1de7df01 (diff)
downloadgperftools-master-issue_626.tar.gz
issue-626: Fix SetupAggressiveDecommit initializationmaster-issue_626
This patch fixes the SetupAggressiveDecommit initialization to run after pageheap_ creation. Current code it not enforcing it, since InitStaticVars is being called outside the static_vars module.
-rw-r--r--src/static_vars.cc8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/static_vars.cc b/src/static_vars.cc
index 1fa9b40..6d08ca1 100644
--- a/src/static_vars.cc
+++ b/src/static_vars.cc
@@ -96,6 +96,7 @@ void Static::InitStaticVars() {
// in is caches as pointers that are sources of heap object liveness,
// which leads to it missing some memory leaks.
pageheap_ = new (MetaDataAlloc(sizeof(PageHeap))) PageHeap;
+ pageheap_->SetAggressiveDecommit(EnvToBool("TCMALLOC_AGGRESSIVE_DECOMMIT", false));
DLL_Init(&sampled_objects_);
Sampler::InitStatics();
}
@@ -114,11 +115,4 @@ REGISTER_MODULE_INITIALIZER(tcmalloc_fork_handler, SetupAtForkLocksHandler());
#endif
-static
-void SetupAggressiveDecommit()
-{
- Static::pageheap()->SetAggressiveDecommit(EnvToBool("TCMALLOC_AGGRESSIVE_DECOMMIT", false));
-}
-REGISTER_MODULE_INITIALIZER(tcmalloc_setup_aggressive_decommit, SetupAggressiveDecommit());
-
} // namespace tcmalloc