| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 totalSize += m_layoutAllocator.root()->totalSizeOfCommittedPages; | 91 totalSize += m_layoutAllocator.root()->totalSizeOfCommittedPages; |
| 92 return totalSize; | 92 return totalSize; |
| 93 } | 93 } |
| 94 | 94 |
| 95 static void decommitFreeableMemory(); | 95 static void decommitFreeableMemory(); |
| 96 | 96 |
| 97 static void reportMemoryUsageHistogram(); | 97 static void reportMemoryUsageHistogram(); |
| 98 | 98 |
| 99 static void dumpMemoryStats(bool isLightDump, PartitionStatsDumper*); | 99 static void dumpMemoryStats(bool isLightDump, PartitionStatsDumper*); |
| 100 | 100 |
| 101 static void setAllocatorPoolNameForTracing(const char* name) { m_allocatorPo
olNameForTracing = name; } |
| 102 static const char* allocatorPoolNameForTracing() { return m_allocatorPoolNam
eForTracing; } |
| 103 |
| 101 ALWAYS_INLINE static void* bufferMalloc(size_t n) | 104 ALWAYS_INLINE static void* bufferMalloc(size_t n) |
| 102 { | 105 { |
| 103 return partitionAllocGeneric(bufferPartition(), n); | 106 return partitionAllocGeneric(bufferPartition(), n); |
| 104 } | 107 } |
| 105 | 108 |
| 106 ALWAYS_INLINE static void* bufferRealloc(void* p, size_t n) | 109 ALWAYS_INLINE static void* bufferRealloc(void* p, size_t n) |
| 107 { | 110 { |
| 108 return partitionReallocGeneric(bufferPartition(), p, n); | 111 return partitionReallocGeneric(bufferPartition(), p, n); |
| 109 } | 112 } |
| 110 | 113 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 136 // - Buffer partition: A partition to allocate objects that have a strong | 139 // - Buffer partition: A partition to allocate objects that have a strong |
| 137 // risk where the length and/or the contents are exploited from user | 140 // risk where the length and/or the contents are exploited from user |
| 138 // scripts. Vectors, HashTables, ArrayBufferContents and Strings are | 141 // scripts. Vectors, HashTables, ArrayBufferContents and Strings are |
| 139 // allocated in the buffer partition. | 142 // allocated in the buffer partition. |
| 140 // - Fast malloc partition: A partition to allocate all other objects. | 143 // - Fast malloc partition: A partition to allocate all other objects. |
| 141 static PartitionAllocatorGeneric m_fastMallocAllocator; | 144 static PartitionAllocatorGeneric m_fastMallocAllocator; |
| 142 static PartitionAllocatorGeneric m_bufferAllocator; | 145 static PartitionAllocatorGeneric m_bufferAllocator; |
| 143 static SizeSpecificPartitionAllocator<3328> m_nodeAllocator; | 146 static SizeSpecificPartitionAllocator<3328> m_nodeAllocator; |
| 144 static SizeSpecificPartitionAllocator<1024> m_layoutAllocator; | 147 static SizeSpecificPartitionAllocator<1024> m_layoutAllocator; |
| 145 static HistogramEnumerationFunction m_histogramEnumeration; | 148 static HistogramEnumerationFunction m_histogramEnumeration; |
| 149 |
| 150 // Stores the allocator name used for tracing allocations from the partition
s. |
| 151 static const char* m_allocatorPoolNameForTracing; |
| 146 }; | 152 }; |
| 147 | 153 |
| 148 } // namespace WTF | 154 } // namespace WTF |
| 149 | 155 |
| 150 #endif // Partitions_h | 156 #endif // Partitions_h |
| OLD | NEW |