summaryrefslogtreecommitdiffstats
path: root/third_party/tcmalloc/vendor/src/heap-checker-bcad.cc
diff options
context:
space:
mode:
authorglider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-31 08:40:56 +0000
committerglider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-31 08:40:56 +0000
commit330391569bd285cbdfabc99fb3873ccc06490d2d (patch)
tree6265244b37e6253f5ab19b831e5bd641b73eb596 /third_party/tcmalloc/vendor/src/heap-checker-bcad.cc
parentda8a9632f03b1a6c053f0eb51cbe476cc8fcad0c (diff)
downloadchromium_src-330391569bd285cbdfabc99fb3873ccc06490d2d.zip
chromium_src-330391569bd285cbdfabc99fb3873ccc06490d2d.tar.gz
chromium_src-330391569bd285cbdfabc99fb3873ccc06490d2d.tar.bz2
Update the tcmalloc vendor branch to r109
Review URL: http://codereview.chromium.org/6965012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87286 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/tcmalloc/vendor/src/heap-checker-bcad.cc')
-rw-r--r--third_party/tcmalloc/vendor/src/heap-checker-bcad.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/third_party/tcmalloc/vendor/src/heap-checker-bcad.cc b/third_party/tcmalloc/vendor/src/heap-checker-bcad.cc
index 87d3d87..82a3109 100644
--- a/third_party/tcmalloc/vendor/src/heap-checker-bcad.cc
+++ b/third_party/tcmalloc/vendor/src/heap-checker-bcad.cc
@@ -51,7 +51,6 @@
// sure this file is not optimized out by the linker.
bool heap_leak_checker_bcad_variable;
-extern void HeapLeakChecker_BeforeConstructors(); // in heap-checker.cc
extern void HeapLeakChecker_AfterDestructors(); // in heap-checker.cc
// A helper class to ensure that some components of heap leak checking
@@ -61,7 +60,12 @@ class HeapLeakCheckerGlobalPrePost {
public:
HeapLeakCheckerGlobalPrePost() {
if (count_ == 0) {
- HeapLeakChecker_BeforeConstructors();
+ // The 'new int' will ensure that we have run an initial malloc
+ // hook, which will set up the heap checker via
+ // MallocHook_InitAtFirstAllocation_HeapLeakChecker. See malloc_hook.cc.
+ // This is done in this roundabout fashion in order to avoid self-deadlock
+ // if we directly called HeapLeakChecker_BeforeConstructors here.
+ delete new int;
// This needs to be called before the first allocation of an STL
// object, but after libc is done setting up threads (because it
// calls setenv, which requires a thread-aware errno). By