diff options
author | earthdok@google.com <earthdok@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-10 11:32:20 +0000 |
---|---|---|
committer | earthdok@google.com <earthdok@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-10 11:32:20 +0000 |
commit | bf709abd190dc73fb16a0d9c8a3855a8ce445a90 (patch) | |
tree | f74a70eab1d1dd5ff7d2b4d93cff72f342b0dcf0 | |
parent | 1fb417f28e5ad9444c2be26bf7e74e76f7f3c1c1 (diff) | |
download | chromium_src-bf709abd190dc73fb16a0d9c8a3855a8ce445a90.zip chromium_src-bf709abd190dc73fb16a0d9c8a3855a8ce445a90.tar.gz chromium_src-bf709abd190dc73fb16a0d9c8a3855a8ce445a90.tar.bz2 |
Annotate the intentional test-only leak in base/tracked_objects.cc.
Remove several HeapChecker suppressions in favor of one annotation.
BUG=136936
R=jar@chromium.org
CC=glider@chromium.org
Review URL: https://chromiumcodereview.appspot.com/16387012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205190 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/tracked_objects.cc | 9 | ||||
-rw-r--r-- | tools/heapcheck/suppressions.txt | 33 |
2 files changed, 8 insertions, 34 deletions
diff --git a/base/tracked_objects.cc b/base/tracked_objects.cc index 55c1ffe..4449d720 100644 --- a/base/tracked_objects.cc +++ b/base/tracked_objects.cc @@ -8,6 +8,7 @@ #include <stdlib.h> #include "base/compiler_specific.h" +#include "base/debug/leak_annotations.h" #include "base/format_macros.h" #include "base/memory/scoped_ptr.h" #include "base/process_util.h" @@ -808,8 +809,14 @@ void ThreadData::ShutdownSingleThreadedCleanup(bool leak) { // To avoid any chance of racing in unit tests, which is the only place we // call this function, we may sometimes leak all the data structures we // recovered, as they may still be in use on threads from prior tests! - if (leak) + if (leak) { + ThreadData* thread_data = thread_data_list; + while (thread_data) { + ANNOTATE_LEAKING_OBJECT_PTR(thread_data); + thread_data = thread_data->next(); + } return; + } // When we want to cleanup (on a single thread), here is what we do. diff --git a/tools/heapcheck/suppressions.txt b/tools/heapcheck/suppressions.txt index 5f96058..9241105 100644 --- a/tools/heapcheck/suppressions.txt +++ b/tools/heapcheck/suppressions.txt @@ -290,23 +290,6 @@ fun:base::ToolsSanityTest_MemoryLeak_Test::TestBody } { - Intentional leak in object tracking statics to avoid shutdown race - Heapcheck:Leak - ... - fun:tracked_objects::ThreadData::Initialize* -} -{ - Intentional leak in object tracking of thread context to avoid shutdown race - Heapcheck:Leak - fun:tracked_objects::ThreadData::Get -} -{ - Intentional leak of task birth and death data to avoid shutdown race - Heapcheck:Leak - ... - fun:tracked_objects::ThreadData::TallyA* -} -{ FileStream::Context can leak through WorkerPool by design (Linux) Heapcheck:Leak fun:net::FileStream::FileStream @@ -909,22 +892,6 @@ fun:ui::InputMethodIBus::Init } { - bug_136936_a - Heapcheck:Leak - ... - fun:std::basic_string::_Rep::_S_create - ... - fun:base::PlatformThread::SetName -} -{ - bug_136936_b - Heapcheck:Leak - ... - fun:std::basic_string::_Rep::_S_create - ... - fun:base::PlatformThread::CurrentId -} -{ bug_143565 Heapcheck:Leak ... |