Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 if (UNLIKELY(!s_initialized)) | 59 if (UNLIKELY(!s_initialized)) |
| 60 initialize(); | 60 initialize(); |
| 61 return m_fastMallocAllocator.root(); | 61 return m_fastMallocAllocator.root(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 ALWAYS_INLINE static PartitionRoot* getObjectModelPartition() | 64 ALWAYS_INLINE static PartitionRoot* getObjectModelPartition() |
| 65 { | 65 { |
| 66 ASSERT(s_initialized); | 66 ASSERT(s_initialized); |
| 67 return m_objectModelAllocator.root(); | 67 return m_objectModelAllocator.root(); |
| 68 } | 68 } |
| 69 ALWAYS_INLINE static PartitionRoot* getRenderingPartition() | 69 ALWAYS_INLINE static PartitionRoot* getLayoutPartition() |
|
tkent
2015/06/16 05:28:43
We don't prepend 'get' to getter functions.
bashi
2015/06/16 05:38:32
Done.
| |
| 70 { | 70 { |
| 71 ASSERT(s_initialized); | 71 ASSERT(s_initialized); |
| 72 return m_renderingAllocator.root(); | 72 return m_layoutAllocator.root(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 static size_t currentDOMMemoryUsage() | 75 static size_t currentDOMMemoryUsage() |
| 76 { | 76 { |
| 77 ASSERT(s_initialized); | 77 ASSERT(s_initialized); |
| 78 return m_objectModelAllocator.root()->totalSizeOfCommittedPages; | 78 return m_objectModelAllocator.root()->totalSizeOfCommittedPages; |
| 79 } | 79 } |
| 80 | 80 |
| 81 static size_t totalSizeOfCommittedPages() | 81 static size_t totalSizeOfCommittedPages() |
| 82 { | 82 { |
| 83 size_t totalSize = 0; | 83 size_t totalSize = 0; |
| 84 totalSize += m_fastMallocAllocator.root()->totalSizeOfCommittedPages; | 84 totalSize += m_fastMallocAllocator.root()->totalSizeOfCommittedPages; |
| 85 totalSize += m_bufferAllocator.root()->totalSizeOfCommittedPages; | 85 totalSize += m_bufferAllocator.root()->totalSizeOfCommittedPages; |
| 86 totalSize += m_objectModelAllocator.root()->totalSizeOfCommittedPages; | 86 totalSize += m_objectModelAllocator.root()->totalSizeOfCommittedPages; |
| 87 totalSize += m_renderingAllocator.root()->totalSizeOfCommittedPages; | 87 totalSize += m_layoutAllocator.root()->totalSizeOfCommittedPages; |
| 88 return totalSize; | 88 return totalSize; |
| 89 } | 89 } |
| 90 | 90 |
| 91 static void decommitFreeableMemory(); | 91 static void decommitFreeableMemory(); |
| 92 | 92 |
| 93 static void reportMemoryUsageHistogram(); | 93 static void reportMemoryUsageHistogram(); |
| 94 | 94 |
| 95 static void dumpMemoryStats(PartitionStatsDumper*); | 95 static void dumpMemoryStats(PartitionStatsDumper*); |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 static bool s_initialized; | 98 static bool s_initialized; |
| 99 static PartitionAllocatorGeneric m_fastMallocAllocator; | 99 static PartitionAllocatorGeneric m_fastMallocAllocator; |
| 100 static PartitionAllocatorGeneric m_bufferAllocator; | 100 static PartitionAllocatorGeneric m_bufferAllocator; |
| 101 static SizeSpecificPartitionAllocator<3328> m_objectModelAllocator; | 101 static SizeSpecificPartitionAllocator<3328> m_objectModelAllocator; |
| 102 static SizeSpecificPartitionAllocator<1024> m_renderingAllocator; | 102 static SizeSpecificPartitionAllocator<1024> m_layoutAllocator; |
| 103 static HistogramEnumerationFunction m_histogramEnumeration; | 103 static HistogramEnumerationFunction m_histogramEnumeration; |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 } // namespace WTF | 106 } // namespace WTF |
| 107 | 107 |
| 108 #endif // Partitions_h | 108 #endif // Partitions_h |
| OLD | NEW |