| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 static void deleteArray(void* ptr) | 112 static void deleteArray(void* ptr) |
| 113 { | 113 { |
| 114 ASSERT_NOT_REACHED(); | 114 ASSERT_NOT_REACHED(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 static bool isAllocationAllowed() | 117 static bool isAllocationAllowed() |
| 118 { | 118 { |
| 119 return ThreadState::current()->isAllocationAllowed(); | 119 return ThreadState::current()->isAllocationAllowed(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 template<typename T> |
| 123 static bool isHeapObjectAlive(T* object) |
| 124 { |
| 125 return Heap::isHeapObjectAlive(object); |
| 126 } |
| 127 |
| 122 template<typename VisitorDispatcher> | 128 template<typename VisitorDispatcher> |
| 123 static void markNoTracing(VisitorDispatcher visitor, const void* t) { visito
r->markNoTracing(t); } | 129 static void markNoTracing(VisitorDispatcher visitor, const void* t) { visito
r->markNoTracing(t); } |
| 124 | 130 |
| 125 template<typename VisitorDispatcher, typename T, typename Traits> | 131 template<typename VisitorDispatcher, typename T, typename Traits> |
| 126 static void trace(VisitorDispatcher visitor, T& t) | 132 static void trace(VisitorDispatcher visitor, T& t) |
| 127 { | 133 { |
| 128 TraceCollectionIfEnabled<WTF::ShouldBeTraced<Traits>::value, Traits::wea
kHandlingFlag, WTF::WeakPointersActWeak, T, Traits>::trace(visitor, t); | 134 TraceCollectionIfEnabled<WTF::ShouldBeTraced<Traits>::value, Traits::wea
kHandlingFlag, WTF::WeakPointersActWeak, T, Traits>::trace(visitor, t); |
| 129 } | 135 } |
| 130 | 136 |
| 131 template<typename VisitorDispatcher> | 137 template<typename VisitorDispatcher> |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 template<typename T, size_t i, typename U> | 457 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); } | 458 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> | 459 template<typename T, typename U, typename V> |
| 454 inline void swap(HeapLinkedHashSet<T, U, V>& a, HeapLinkedHashSet<T, U, V>& b) {
a.swap(b); } | 460 inline void swap(HeapLinkedHashSet<T, U, V>& a, HeapLinkedHashSet<T, U, V>& b) {
a.swap(b); } |
| 455 template<typename T, typename U, typename V> | 461 template<typename T, typename U, typename V> |
| 456 inline void swap(HeapHashCountedSet<T, U, V>& a, HeapHashCountedSet<T, U, V>& b)
{ a.swap(b); } | 462 inline void swap(HeapHashCountedSet<T, U, V>& a, HeapHashCountedSet<T, U, V>& b)
{ a.swap(b); } |
| 457 | 463 |
| 458 } // namespace blink | 464 } // namespace blink |
| 459 | 465 |
| 460 #endif | 466 #endif |
| OLD | NEW |