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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 static void decommitFreeableMemory(); | 84 static void decommitFreeableMemory(); |
85 | 85 |
86 static void reportMemoryUsageHistogram(); | 86 static void reportMemoryUsageHistogram(); |
87 | 87 |
88 static void dumpMemoryStats(bool isLightDump, PartitionStatsDumper*); | 88 static void dumpMemoryStats(bool isLightDump, PartitionStatsDumper*); |
89 | 89 |
90 ALWAYS_INLINE static void* bufferMalloc(size_t n, const char* typeName) { | 90 ALWAYS_INLINE static void* bufferMalloc(size_t n, const char* typeName) { |
91 return partitionAllocGeneric(bufferPartition(), n, typeName); | 91 return partitionAllocGeneric(bufferPartition(), n, typeName); |
92 } | 92 } |
| 93 ALWAYS_INLINE static void* bufferRealloc(void* p, |
| 94 size_t n, |
| 95 const char* typeName) { |
| 96 return partitionReallocGeneric(bufferPartition(), p, n, typeName); |
| 97 } |
93 ALWAYS_INLINE static void bufferFree(void* p) { | 98 ALWAYS_INLINE static void bufferFree(void* p) { |
94 partitionFreeGeneric(bufferPartition(), p); | 99 partitionFreeGeneric(bufferPartition(), p); |
95 } | 100 } |
96 ALWAYS_INLINE static size_t bufferActualSize(size_t n) { | 101 ALWAYS_INLINE static size_t bufferActualSize(size_t n) { |
97 return partitionAllocActualSize(bufferPartition(), n); | 102 return partitionAllocActualSize(bufferPartition(), n); |
98 } | 103 } |
99 static void* fastMalloc(size_t n, const char* typeName) { | 104 static void* fastMalloc(size_t n, const char* typeName) { |
100 return partitionAllocGeneric(Partitions::fastMallocPartition(), n, | 105 return partitionAllocGeneric(Partitions::fastMallocPartition(), n, |
101 typeName); | 106 typeName); |
102 } | 107 } |
(...skipping 30 matching lines...) Expand all Loading... |
133 // - Fast malloc partition: A partition to allocate all other objects. | 138 // - Fast malloc partition: A partition to allocate all other objects. |
134 static PartitionAllocatorGeneric m_fastMallocAllocator; | 139 static PartitionAllocatorGeneric m_fastMallocAllocator; |
135 static PartitionAllocatorGeneric m_bufferAllocator; | 140 static PartitionAllocatorGeneric m_bufferAllocator; |
136 static SizeSpecificPartitionAllocator<1024> m_layoutAllocator; | 141 static SizeSpecificPartitionAllocator<1024> m_layoutAllocator; |
137 static ReportPartitionAllocSizeFunction m_reportSizeFunction; | 142 static ReportPartitionAllocSizeFunction m_reportSizeFunction; |
138 }; | 143 }; |
139 | 144 |
140 } // namespace WTF | 145 } // namespace WTF |
141 | 146 |
142 #endif // Partitions_h | 147 #endif // Partitions_h |
OLD | NEW |