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

Unified Diff: Source/wtf/Partitions.cpp

Issue 1190883003: Set HistogramEnumerationFunction even when Partitions are initialized (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove lock Created 5 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
« no previous file with comments | « Source/wtf/Partitions.h ('k') | Source/wtf/WTF.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/Partitions.cpp
diff --git a/Source/wtf/Partitions.cpp b/Source/wtf/Partitions.cpp
index c8f6e7500d803eea15b326e87bbd67075f7f1111..21f009d1fba76ae4fe68184a33d0cfb3282c149e 100644
--- a/Source/wtf/Partitions.cpp
+++ b/Source/wtf/Partitions.cpp
@@ -45,20 +45,24 @@ SizeSpecificPartitionAllocator<3328> Partitions::m_objectModelAllocator;
SizeSpecificPartitionAllocator<1024> Partitions::m_layoutAllocator;
HistogramEnumerationFunction Partitions::m_histogramEnumeration = nullptr;
-void Partitions::initialize(HistogramEnumerationFunction histogramEnumeration)
+void Partitions::initialize()
{
- static int lock = 0;
- // Guard against two threads hitting here in parallel.
- spinLockLock(&lock);
+ // TODO(bashi): Add ASSERT(isMainThread()).
+ // This could be called before WTF::initialize() is called so we can't
+ // rely on isMainThread() at this point.
haraken 2015/06/17 14:20:33 Sorry, I noticed this file is already including Ma
bashi 2015/06/18 22:53:37 Removed.
if (!s_initialized) {
m_fastMallocAllocator.init();
m_bufferAllocator.init();
m_objectModelAllocator.init();
m_layoutAllocator.init();
- m_histogramEnumeration = histogramEnumeration;
s_initialized = true;
}
- spinLockUnlock(&lock);
+}
+
+void Partitions::setHistogramEnumeration(HistogramEnumerationFunction histogramEnumeration)
+{
+ ASSERT(!m_histogramEnumeration);
+ m_histogramEnumeration = histogramEnumeration;
}
void Partitions::shutdown()
« no previous file with comments | « Source/wtf/Partitions.h ('k') | Source/wtf/WTF.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698