summaryrefslogtreecommitdiff
path: root/src/third_party
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2014-06-03 13:47:57 -0400
committerBenety Goh <benety@mongodb.com>2014-06-05 08:51:34 -0400
commit8da74f764b055cd610fa41d54c5283faf0986c88 (patch)
treeda75e7039575311a068e14f6495bb753b047cc68 /src/third_party
parentfff5d13830e44fbca742ad6c61239f439864ae29 (diff)
downloadmongo-8da74f764b055cd610fa41d54c5283faf0986c88.tar.gz
SERVER-8995 cherry picked gperftools revision 81d99f21ede7
issue-626: Fix SetupAggressiveDecommit initialization 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. Issue details: https://code.google.com/p/gperftools/issues/detail?id=626 Revision details: https://code.google.com/p/gperftools/source/detail?r=81d99f21ede78ab8d5fec15d0055416ac1b581f3
Diffstat (limited to 'src/third_party')
-rw-r--r--src/third_party/gperftools-2.2/src/static_vars.cc8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/third_party/gperftools-2.2/src/static_vars.cc b/src/third_party/gperftools-2.2/src/static_vars.cc
index 1fa9b40cef7..6d08ca1872c 100644
--- a/src/third_party/gperftools-2.2/src/static_vars.cc
+++ b/src/third_party/gperftools-2.2/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