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

Unified Diff: third_party/WebKit/Source/wtf/allocator/Partitions.cpp

Issue 2682943002: Create a dedicated partition for array buffers (Closed)
Patch Set: temp Created 3 years, 10 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: third_party/WebKit/Source/wtf/allocator/Partitions.cpp
diff --git a/third_party/WebKit/Source/wtf/allocator/Partitions.cpp b/third_party/WebKit/Source/wtf/allocator/Partitions.cpp
index 04602cf8131be2d3403ab2e28c340441adbb0f44..bcc4658ac475771cfa5b303fc6902768dd1a0238 100644
--- a/third_party/WebKit/Source/wtf/allocator/Partitions.cpp
+++ b/third_party/WebKit/Source/wtf/allocator/Partitions.cpp
@@ -43,6 +43,7 @@ base::subtle::SpinLock Partitions::s_initializationLock;
bool Partitions::s_initialized = false;
base::PartitionAllocatorGeneric Partitions::m_fastMallocAllocator;
+base::PartitionAllocatorGeneric Partitions::m_arrayBufferAllocator;
base::PartitionAllocatorGeneric Partitions::m_bufferAllocator;
base::SizeSpecificPartitionAllocator<1024> Partitions::m_layoutAllocator;
Partitions::ReportPartitionAllocSizeFunction Partitions::m_reportSizeFunction =
@@ -55,6 +56,7 @@ void Partitions::initialize(
if (!s_initialized) {
base::PartitionAllocGlobalInit(&Partitions::handleOutOfMemory);
m_fastMallocAllocator.init();
+ m_arrayBufferAllocator.init();
m_bufferAllocator.init();
m_layoutAllocator.init();
m_reportSizeFunction = reportSizeFunction;
@@ -67,6 +69,8 @@ void Partitions::decommitFreeableMemory() {
if (!s_initialized)
return;
+ PartitionPurgeMemoryGeneric(arrayBufferPartition(),
+ base::PartitionPurgeDecommitEmptyPages);
PartitionPurgeMemoryGeneric(bufferPartition(),
base::PartitionPurgeDecommitEmptyPages);
PartitionPurgeMemoryGeneric(fastMallocPartition(),
@@ -101,6 +105,8 @@ void Partitions::dumpMemoryStats(
decommitFreeableMemory();
PartitionDumpStatsGeneric(fastMallocPartition(), "fast_malloc", isLightDump,
partitionStatsDumper);
+ PartitionDumpStatsGeneric(arrayBufferPartition(), "array_buffer", isLightDump,
+ partitionStatsDumper);
PartitionDumpStatsGeneric(bufferPartition(), "buffer", isLightDump,
partitionStatsDumper);
PartitionDumpStats(layoutPartition(), "layout", isLightDump,

Powered by Google App Engine
This is Rietveld 408576698