Chromium Code Reviews| Index: Source/wtf/Partitions.h |
| diff --git a/Source/wtf/Partitions.h b/Source/wtf/Partitions.h |
| index 4529ba0cd008b8ccede2d06a42842adf253b27e7..b617ec270cd6821fff7f47c49e38c191958c553e 100644 |
| --- a/Source/wtf/Partitions.h |
| +++ b/Source/wtf/Partitions.h |
| @@ -47,16 +47,33 @@ public: |
| return m_bufferAllocator.root(); |
| } |
| - ALWAYS_INLINE static PartitionRoot* getObjectModelPartition() { return m_objectModelAllocator.root(); } |
| - ALWAYS_INLINE static PartitionRoot* getRenderingPartition() { return m_renderingAllocator.root(); } |
| + ALWAYS_INLINE static PartitionRootGeneric* getFastMallocPartition() |
| + { |
| + if (UNLIKELY(!s_initialized)) |
| + initialize(); |
|
tkent
2015/04/01 01:26:09
Why is this necessary? Is it possible to call get
haraken
2015/04/01 01:33:07
Yes, it's possible. The fastmalloc allocator (and
tkent
2015/04/01 01:35:37
I see. Thanks.
Adding comments to getFastMallocP
Chris Evans
2015/04/01 01:38:48
Is that fixable I wonder? It'd be nice to remove t
|
| + return m_fastMallocAllocator.root(); |
| + } |
| + |
| + ALWAYS_INLINE static PartitionRoot* getObjectModelPartition() |
| + { |
| + ASSERT(s_initialized); |
| + return m_objectModelAllocator.root(); |
| + } |
| + ALWAYS_INLINE static PartitionRoot* getRenderingPartition() |
| + { |
| + ASSERT(s_initialized); |
| + return m_renderingAllocator.root(); |
| + } |
| static size_t currentDOMMemoryUsage() |
| { |
| + ASSERT(s_initialized); |
| return m_objectModelAllocator.root()->totalSizeOfCommittedPages; |
| } |
| private: |
| static bool s_initialized; |
| + static PartitionAllocatorGeneric m_fastMallocAllocator; |
| static PartitionAllocatorGeneric m_bufferAllocator; |
| static SizeSpecificPartitionAllocator<3328> m_objectModelAllocator; |
| static SizeSpecificPartitionAllocator<1024> m_renderingAllocator; |