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 |