| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WTF_PartitionAllocator_h | 5 #ifndef WTF_PartitionAllocator_h |
| 6 #define WTF_PartitionAllocator_h | 6 #define WTF_PartitionAllocator_h |
| 7 | 7 |
| 8 // This is the allocator that is used for allocations that are not on the | 8 // This is the allocator that is used for allocations that are not on the |
| 9 // traced, garbage collected heap. It uses FastMalloc for collections, | 9 // traced, garbage collected heap. It uses FastMalloc for collections, |
| 10 // but uses the partition allocator for the backing store of the collections. | 10 // but uses the partition allocator for the backing store of the collections. |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 void* operator new(size_t size) { \ | 121 void* operator new(size_t size) { \ |
| 122 return Allocator::template malloc<void*, ClassName>( \ | 122 return Allocator::template malloc<void*, ClassName>( \ |
| 123 size, WTF_HEAP_PROFILER_TYPE_NAME(ClassName)); \ | 123 size, WTF_HEAP_PROFILER_TYPE_NAME(ClassName)); \ |
| 124 } \ | 124 } \ |
| 125 void operator delete(void* p) { Allocator::free(p); } \ | 125 void operator delete(void* p) { Allocator::free(p); } \ |
| 126 void* operator new[](size_t size) { \ | 126 void* operator new[](size_t size) { \ |
| 127 return Allocator::template newArray<ClassName>(size); \ | 127 return Allocator::template newArray<ClassName>(size); \ |
| 128 } \ | 128 } \ |
| 129 void operator delete[](void* p) { Allocator::deleteArray(p); } \ | 129 void operator delete[](void* p) { Allocator::deleteArray(p); } \ |
| 130 void* operator new(size_t, NotNullTag, void* location) { \ | 130 void* operator new(size_t, NotNullTag, void* location) { \ |
| 131 ASSERT(location); \ | 131 DCHECK(location); \ |
| 132 return location; \ | 132 return location; \ |
| 133 } \ | 133 } \ |
| 134 void* operator new(size_t, void* location) { return location; } \ | 134 void* operator new(size_t, void* location) { return location; } \ |
| 135 \ | 135 \ |
| 136 private: \ | 136 private: \ |
| 137 typedef int __thisIsHereToForceASemicolonAfterThisMacro | 137 typedef int __thisIsHereToForceASemicolonAfterThisMacro |
| 138 | 138 |
| 139 #endif // WTF_PartitionAllocator_h | 139 #endif // WTF_PartitionAllocator_h |
| OLD | NEW |