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

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

Issue 304033004: InstanceCounter/Oilpan GC tracing: Add clang support (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: objectGraphMutex Created 6 years, 7 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 | « no previous file | Source/wtf/InstanceCounter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Heap.cpp
diff --git a/Source/platform/heap/Heap.cpp b/Source/platform/heap/Heap.cpp
index 6a11b328b0382f56ab08705c96fc94ddba2ac951..4b5d24ac72c5084268cfc9dc091039b8212ff32e 100644
--- a/Source/platform/heap/Heap.cpp
+++ b/Source/platform/heap/Heap.cpp
@@ -1314,6 +1314,7 @@ public:
return;
header->mark();
#if ENABLE(GC_TRACING)
+ MutexLocker locker(objectGraphMutex());
String className(classOf(objectPointer));
{
LiveObjectMap::AddResult result = currentlyLive().add(className, LiveObjectSet());
@@ -1469,6 +1470,12 @@ public:
objectsToFindPath().add(reinterpret_cast<uintptr_t>(p));
}
+ static Mutex& objectGraphMutex()
+ {
+ AtomicallyInitializedStatic(Mutex&, mutex = *new Mutex);
tkent 2014/05/29 12:43:05 This looks unnatural. Does the following work?
+ return mutex;
+ }
+
static LiveObjectMap& previouslyLive()
{
DEFINE_STATIC_LOCAL(LiveObjectMap, map, ());
« no previous file with comments | « no previous file | Source/wtf/InstanceCounter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698