Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(705)

Unified Diff: third_party/tcmalloc/chromium/src/heap-checker-bcad.cc

Issue 7050034: Merge google-perftools r109 (the current contents of third_party/tcmalloc/vendor) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/tcmalloc/chromium/src/heap-checker-bcad.cc
===================================================================
--- third_party/tcmalloc/chromium/src/heap-checker-bcad.cc (revision 88335)
+++ third_party/tcmalloc/chromium/src/heap-checker-bcad.cc (working copy)
@@ -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 @@
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
« no previous file with comments | « third_party/tcmalloc/chromium/src/heap-checker.cc ('k') | third_party/tcmalloc/chromium/src/heap-profile-table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698