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

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
Index: Source/wtf/Partitions.h
diff --git a/Source/wtf/WTF.h b/Source/wtf/Partitions.h
similarity index 81%
rename from Source/wtf/WTF.h
rename to Source/wtf/Partitions.h
index d42bf2a27765f71a03fec47bd7996bf4079ba8ca..c29106ec2b1f780de39c20246bb91be6348b0119 100644
--- a/Source/wtf/WTF.h
+++ b/Source/wtf/Partitions.h
@@ -28,8 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WTF_h
-#define WTF_h
+#ifndef Partitions_h
+#define Partitions_h
#include "wtf/Compiler.h"
#include "wtf/CurrentTime.h"
@@ -54,11 +54,21 @@ public:
return m_bufferAllocator.root();
}
+ ALWAYS_INLINE static PartitionRoot* getObjectModelPartition() { return m_objectModelAllocator.root(); }
Chris Evans 2015/03/30 18:41:36 Nit: "ALWAYS_INLINE static" is a different orderin
haraken 2015/03/30 23:06:18 Blink mixes both, but it seems 'ALWAYS_INLINE stat
+ ALWAYS_INLINE static PartitionRoot* getRenderingPartition() { return m_renderingAllocator.root(); }
+
+ static size_t currentDOMMemoryUsage()
+ {
+ return m_objectModelAllocator.root()->totalSizeOfCommittedPages;
+ }
+
private:
static bool s_initialized;
static PartitionAllocatorGeneric m_bufferAllocator;
+ static SizeSpecificPartitionAllocator<3328> m_objectModelAllocator;
+ static SizeSpecificPartitionAllocator<1024> m_renderingAllocator;
};
} // namespace WTF
-#endif // WTF_h
+#endif // Partitions_h
« no previous file with comments | « Source/wtf/HashTable.h ('k') | Source/wtf/Partitions.cpp » ('j') | Source/wtf/Partitions.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698