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/Allocator.h" | 10 #include "wtf/Allocator.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 } | 143 } |
144 | 144 |
145 #if ENABLE(ASSERT) | 145 #if ENABLE(ASSERT) |
146 template<typename VisitorDispatcher> | 146 template<typename VisitorDispatcher> |
147 static bool weakTableRegistered(VisitorDispatcher visitor, const void* closu
re) | 147 static bool weakTableRegistered(VisitorDispatcher visitor, const void* closu
re) |
148 { | 148 { |
149 return visitor->weakTableRegistered(closure); | 149 return visitor->weakTableRegistered(closure); |
150 } | 150 } |
151 #endif | 151 #endif |
152 | 152 |
153 template<typename T> | |
154 struct ResultType { | |
155 using Type = T*; | |
156 }; | |
157 | |
158 template<typename T> | |
159 struct OtherType { | |
160 using Type = T*; | |
161 }; | |
162 | |
163 template<typename T> | |
164 static T& getOther(T* other) | |
165 { | |
166 return *other; | |
167 } | |
168 | |
169 static void enterGCForbiddenScope() | 153 static void enterGCForbiddenScope() |
170 { | 154 { |
171 ThreadState::current()->enterGCForbiddenScope(); | 155 ThreadState::current()->enterGCForbiddenScope(); |
172 } | 156 } |
173 | 157 |
174 static void leaveGCForbiddenScope() | 158 static void leaveGCForbiddenScope() |
175 { | 159 { |
176 ThreadState::current()->leaveGCForbiddenScope(); | 160 ThreadState::current()->leaveGCForbiddenScope(); |
177 } | 161 } |
178 | 162 |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 static_assert(sizeof(T), "T must be fully defined"); | 552 static_assert(sizeof(T), "T must be fully defined"); |
569 // All heap allocated node pointers need visiting to keep the nodes alive, | 553 // All heap allocated node pointers need visiting to keep the nodes alive, |
570 // regardless of whether they contain pointers to other heap allocated | 554 // regardless of whether they contain pointers to other heap allocated |
571 // objects. | 555 // objects. |
572 static const bool value = true; | 556 static const bool value = true; |
573 }; | 557 }; |
574 | 558 |
575 } // namespace WTF | 559 } // namespace WTF |
576 | 560 |
577 #endif | 561 #endif |
OLD | NEW |