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

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

Issue 794223003: Cheaper thread-safe atomic initialization of static references. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add type check for initial value Created 5 years, 11 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: Source/platform/heap/Heap.cpp
diff --git a/Source/platform/heap/Heap.cpp b/Source/platform/heap/Heap.cpp
index 5f2e53e88668a89d9296a576a08ae82f6d1dea23..04be9da29d692c6ca97b7d9c0da13a6c86ca9d54 100644
--- a/Source/platform/heap/Heap.cpp
+++ b/Source/platform/heap/Heap.cpp
@@ -1991,7 +1991,7 @@ public:
static Mutex& objectGraphMutex()
{
- AtomicallyInitializedStatic(Mutex&, mutex = *new Mutex);
+ AtomicallyInitializedStaticReference(Mutex, mutex, new Mutex);
return mutex;
}
@@ -2626,7 +2626,7 @@ BaseHeapPage* Heap::lookup(Address address)
static Mutex& regionTreeMutex()
{
- AtomicallyInitializedStatic(Mutex&, mutex = *new Mutex);
+ AtomicallyInitializedStaticReference(Mutex, mutex, new Mutex);
return mutex;
}

Powered by Google App Engine
This is Rietveld 408576698