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

Unified Diff: Source/wtf/Partitions.h

Issue 1041103002: PartitionAlloc: Centralize Partition allocators into one place (Part 1) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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/HashTable.h ('k') | Source/wtf/Partitions.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/Partitions.h
diff --git a/Source/platform/Partitions.h b/Source/wtf/Partitions.h
similarity index 84%
rename from Source/platform/Partitions.h
rename to Source/wtf/Partitions.h
index adfab7b72d1d85db7f4757f79148362100884f08..4529ba0cd008b8ccede2d06a42842adf253b27e7 100644
--- a/Source/platform/Partitions.h
+++ b/Source/wtf/Partitions.h
@@ -31,15 +31,21 @@
#ifndef Partitions_h
#define Partitions_h
-#include "platform/PlatformExport.h"
#include "wtf/PartitionAlloc.h"
+#include "wtf/WTFExport.h"
-namespace blink {
+namespace WTF {
-class PLATFORM_EXPORT Partitions {
+class WTF_EXPORT Partitions {
public:
- static void init();
+ static void initialize();
static void shutdown();
+ ALWAYS_INLINE static PartitionRootGeneric* getBufferPartition()
+ {
+ if (UNLIKELY(!s_initialized))
+ initialize();
+ return m_bufferAllocator.root();
+ }
ALWAYS_INLINE static PartitionRoot* getObjectModelPartition() { return m_objectModelAllocator.root(); }
ALWAYS_INLINE static PartitionRoot* getRenderingPartition() { return m_renderingAllocator.root(); }
@@ -50,10 +56,12 @@ public:
}
private:
+ static bool s_initialized;
+ static PartitionAllocatorGeneric m_bufferAllocator;
static SizeSpecificPartitionAllocator<3328> m_objectModelAllocator;
static SizeSpecificPartitionAllocator<1024> m_renderingAllocator;
};
-} // namespace blink
+} // namespace WTF
#endif // Partitions_h
« no previous file with comments | « Source/wtf/HashTable.h ('k') | Source/wtf/Partitions.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698