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

Unified Diff: Source/platform/heap/PersistentNode.cpp

Issue 1275863002: Oilpan: catch some self-referential leaks (main thread.) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add stdio.h include Created 5 years, 4 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
« no previous file with comments | « Source/platform/heap/PersistentNode.h ('k') | Source/platform/heap/ThreadState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/PersistentNode.cpp
diff --git a/Source/platform/heap/PersistentNode.cpp b/Source/platform/heap/PersistentNode.cpp
index 6271f7d6ea72c36c01868d2a242d3f18b4db3406..e5981176d5e1c8004cf903648a073a0f0fac75ae 100644
--- a/Source/platform/heap/PersistentNode.cpp
+++ b/Source/platform/heap/PersistentNode.cpp
@@ -7,6 +7,10 @@
#include "platform/heap/Handle.h"
+#ifndef NDEBUG
+#include <stdio.h>
+#endif
+
namespace blink {
PersistentRegion::~PersistentRegion()
@@ -32,6 +36,25 @@ int PersistentRegion::numberOfPersistents()
return persistentCount;
}
+#ifndef NDEBUG
+void PersistentRegion::dumpLivePersistents()
+{
+ class Object;
+ using GCObject = GarbageCollected<Object>;
+
+ fprintf(stderr, "Live Persistent(heap object, trace method):\n");
+ for (PersistentNodeSlots* slots = m_slots; slots; slots = slots->m_next) {
+ for (int i = 0; i < PersistentNodeSlots::slotCount; ++i) {
+ if (!slots->m_slot[i].isUnused()) {
+ Persistent<GCObject>* persistent = reinterpret_cast<Persistent<GCObject>*>(slots->m_slot[i].self());
+ ASSERT(persistent);
+ fprintf(stderr, "%p => (%p, %p)\n", persistent, persistent->get(), slots->m_slot[i].traceCallback());
+ }
+ }
+ }
+}
+#endif
+
void PersistentRegion::ensurePersistentNodeSlots(void* self, TraceCallback trace)
{
ASSERT(!m_freeListHead);
« no previous file with comments | « Source/platform/heap/PersistentNode.h ('k') | Source/platform/heap/ThreadState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698