OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 HeapAllocator_h | 5 #ifndef HeapAllocator_h |
6 #define HeapAllocator_h | 6 #define HeapAllocator_h |
7 | 7 |
8 #include "platform/heap/Heap.h" | 8 #include "platform/heap/Heap.h" |
9 #include "platform/heap/TraceTraits.h" | 9 #include "platform/heap/TraceTraits.h" |
10 #include "wtf/Assertions.h" | 10 #include "wtf/Assertions.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 static T* allocateZeroedHashTableBacking(size_t size) | 92 static T* allocateZeroedHashTableBacking(size_t size) |
93 { | 93 { |
94 return allocateHashTableBacking<T, HashTable>(size); | 94 return allocateHashTableBacking<T, HashTable>(size); |
95 } | 95 } |
96 PLATFORM_EXPORT static void freeHashTableBacking(void* address); | 96 PLATFORM_EXPORT static void freeHashTableBacking(void* address); |
97 PLATFORM_EXPORT static bool expandHashTableBacking(void*, size_t); | 97 PLATFORM_EXPORT static bool expandHashTableBacking(void*, size_t); |
98 | 98 |
99 template <typename Return, typename Metadata> | 99 template <typename Return, typename Metadata> |
100 static Return malloc(size_t size) | 100 static Return malloc(size_t size) |
101 { | 101 { |
102 return reinterpret_cast<Return>(Heap::allocate<Metadata>(size)); | 102 return reinterpret_cast<Return>(Heap::allocate<Metadata>(size, IsEagerly
FinalizedType<Metadata>::value)); |
103 } | 103 } |
104 static void free(void* address) { } | 104 static void free(void* address) { } |
105 template<typename T> | 105 template<typename T> |
106 static void* newArray(size_t bytes) | 106 static void* newArray(size_t bytes) |
107 { | 107 { |
108 ASSERT_NOT_REACHED(); | 108 ASSERT_NOT_REACHED(); |
109 return 0; | 109 return 0; |
110 } | 110 } |
111 | 111 |
112 static void deleteArray(void* ptr) | 112 static void deleteArray(void* ptr) |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 template<typename T, size_t i, typename U> | 451 template<typename T, size_t i, typename U> |
452 inline void swap(HeapListHashSet<T, i, U>& a, HeapListHashSet<T, i, U>& b) { a.s
wap(b); } | 452 inline void swap(HeapListHashSet<T, i, U>& a, HeapListHashSet<T, i, U>& b) { a.s
wap(b); } |
453 template<typename T, typename U, typename V> | 453 template<typename T, typename U, typename V> |
454 inline void swap(HeapLinkedHashSet<T, U, V>& a, HeapLinkedHashSet<T, U, V>& b) {
a.swap(b); } | 454 inline void swap(HeapLinkedHashSet<T, U, V>& a, HeapLinkedHashSet<T, U, V>& b) {
a.swap(b); } |
455 template<typename T, typename U, typename V> | 455 template<typename T, typename U, typename V> |
456 inline void swap(HeapHashCountedSet<T, U, V>& a, HeapHashCountedSet<T, U, V>& b)
{ a.swap(b); } | 456 inline void swap(HeapHashCountedSet<T, U, V>& a, HeapHashCountedSet<T, U, V>& b)
{ a.swap(b); } |
457 | 457 |
458 } // namespace blink | 458 } // namespace blink |
459 | 459 |
460 #endif | 460 #endif |
OLD | NEW |