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

Side by Side Diff: Source/wtf/Partitions.cpp

Issue 1190173003: PartitionAlloc: API changes to support new partitionPurgeMemoryGeneric() mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review feedback. Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « Source/wtf/PartitionAllocTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 (void) m_layoutAllocator.shutdown(); 69 (void) m_layoutAllocator.shutdown();
70 (void) m_objectModelAllocator.shutdown(); 70 (void) m_objectModelAllocator.shutdown();
71 (void) m_bufferAllocator.shutdown(); 71 (void) m_bufferAllocator.shutdown();
72 (void) m_fastMallocAllocator.shutdown(); 72 (void) m_fastMallocAllocator.shutdown();
73 } 73 }
74 74
75 void Partitions::decommitFreeableMemory() 75 void Partitions::decommitFreeableMemory()
76 { 76 {
77 ASSERT(isMainThread()); 77 ASSERT(isMainThread());
78 78
79 partitionPurgeMemoryGeneric(bufferPartition()); 79 partitionPurgeMemoryGeneric(bufferPartition(), PartitionPurgeDecommitEmptyPa ges);
80 partitionPurgeMemoryGeneric(fastMallocPartition()); 80 partitionPurgeMemoryGeneric(fastMallocPartition(), PartitionPurgeDecommitEmp tyPages);
81 partitionPurgeMemory(objectModelPartition()); 81 partitionPurgeMemory(objectModelPartition(), PartitionPurgeDecommitEmptyPage s);
82 partitionPurgeMemory(layoutPartition()); 82 partitionPurgeMemory(layoutPartition(), PartitionPurgeDecommitEmptyPages);
83 } 83 }
84 84
85 void Partitions::reportMemoryUsageHistogram() 85 void Partitions::reportMemoryUsageHistogram()
86 { 86 {
87 static size_t supportedMaxSizeInMB = 4 * 1024; 87 static size_t supportedMaxSizeInMB = 4 * 1024;
88 static size_t observedMaxSizeInMB = 0; 88 static size_t observedMaxSizeInMB = 0;
89 89
90 if (!m_histogramEnumeration) 90 if (!m_histogramEnumeration)
91 return; 91 return;
92 // We only report the memory in the main thread. 92 // We only report the memory in the main thread.
(...skipping 17 matching lines...) Expand all
110 // accessed only on the main thread. 110 // accessed only on the main thread.
111 ASSERT(isMainThread()); 111 ASSERT(isMainThread());
112 112
113 partitionDumpStatsGeneric(fastMallocPartition(), "fast_malloc_partition", pa rtitionStatsDumper); 113 partitionDumpStatsGeneric(fastMallocPartition(), "fast_malloc_partition", pa rtitionStatsDumper);
114 partitionDumpStatsGeneric(bufferPartition(), "buffer_partition", partitionSt atsDumper); 114 partitionDumpStatsGeneric(bufferPartition(), "buffer_partition", partitionSt atsDumper);
115 partitionDumpStats(objectModelPartition(), "object_model_partition", partiti onStatsDumper); 115 partitionDumpStats(objectModelPartition(), "object_model_partition", partiti onStatsDumper);
116 partitionDumpStats(layoutPartition(), "layout_partition", partitionStatsDump er); 116 partitionDumpStats(layoutPartition(), "layout_partition", partitionStatsDump er);
117 } 117 }
118 118
119 } // namespace WTF 119 } // namespace WTF
OLDNEW
« no previous file with comments | « Source/wtf/PartitionAllocTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698