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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 return totalSize; | 81 return totalSize; |
82 } | 82 } |
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 void* p = partitionAllocGeneric(bufferPartition(), n, typeName); |
| 92 if (strcmp(typeName, "SerializedScriptValue buffer") == 0) |
| 93 LOG(ERROR) << "bufferMalloc(" << n << ", " << typeName << ") -> " << p; |
| 94 return p; |
92 } | 95 } |
93 ALWAYS_INLINE static void* bufferRealloc(void* p, | 96 ALWAYS_INLINE static void* bufferRealloc(void* p, |
94 size_t n, | 97 size_t n, |
95 const char* typeName) { | 98 const char* typeName) { |
96 return partitionReallocGeneric(bufferPartition(), p, n, typeName); | 99 void* p2 = partitionReallocGeneric(bufferPartition(), p, n, typeName); |
| 100 if (strcmp(typeName, "SerializedScriptValue buffer") == 0) |
| 101 LOG(ERROR) << "bufferRealloc(" << p << ", " << n << ", " << typeName << ")
-> " << p2; |
| 102 return p2; |
97 } | 103 } |
98 ALWAYS_INLINE static void bufferFree(void* p) { | 104 ALWAYS_INLINE static void bufferFree(void* p) { |
99 partitionFreeGeneric(bufferPartition(), p); | 105 partitionFreeGeneric(bufferPartition(), p); |
100 } | 106 } |
101 ALWAYS_INLINE static size_t bufferActualSize(size_t n) { | 107 ALWAYS_INLINE static size_t bufferActualSize(size_t n) { |
102 return partitionAllocActualSize(bufferPartition(), n); | 108 return partitionAllocActualSize(bufferPartition(), n); |
103 } | 109 } |
104 static void* fastMalloc(size_t n, const char* typeName) { | 110 static void* fastMalloc(size_t n, const char* typeName) { |
105 return partitionAllocGeneric(Partitions::fastMallocPartition(), n, | 111 return partitionAllocGeneric(Partitions::fastMallocPartition(), n, |
106 typeName); | 112 typeName); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // - Fast malloc partition: A partition to allocate all other objects. | 144 // - Fast malloc partition: A partition to allocate all other objects. |
139 static PartitionAllocatorGeneric m_fastMallocAllocator; | 145 static PartitionAllocatorGeneric m_fastMallocAllocator; |
140 static PartitionAllocatorGeneric m_bufferAllocator; | 146 static PartitionAllocatorGeneric m_bufferAllocator; |
141 static SizeSpecificPartitionAllocator<1024> m_layoutAllocator; | 147 static SizeSpecificPartitionAllocator<1024> m_layoutAllocator; |
142 static ReportPartitionAllocSizeFunction m_reportSizeFunction; | 148 static ReportPartitionAllocSizeFunction m_reportSizeFunction; |
143 }; | 149 }; |
144 | 150 |
145 } // namespace WTF | 151 } // namespace WTF |
146 | 152 |
147 #endif // Partitions_h | 153 #endif // Partitions_h |
OLD | NEW |