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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 struct OtherType { | 154 struct OtherType { |
155 using Type = T*; | 155 using Type = T*; |
156 }; | 156 }; |
157 | 157 |
158 template<typename T> | 158 template<typename T> |
159 static T& getOther(T* other) | 159 static T& getOther(T* other) |
160 { | 160 { |
161 return *other; | 161 return *other; |
162 } | 162 } |
163 | 163 |
164 static void enterNoAllocationScope() | |
165 { | |
166 #if ENABLE(ASSERT) | |
167 ThreadState::current()->enterNoAllocationScope(); | |
168 #endif | |
169 } | |
170 | |
171 static void leaveNoAllocationScope() | |
172 { | |
173 #if ENABLE(ASSERT) | |
174 ThreadState::current()->leaveNoAllocationScope(); | |
175 #endif | |
176 } | |
177 | |
178 static void enterGCForbiddenScope() | 164 static void enterGCForbiddenScope() |
179 { | 165 { |
180 ThreadState::current()->enterGCForbiddenScope(); | 166 ThreadState::current()->enterGCForbiddenScope(); |
181 } | 167 } |
182 | 168 |
183 static void leaveGCForbiddenScope() | 169 static void leaveGCForbiddenScope() |
184 { | 170 { |
185 ThreadState::current()->leaveGCForbiddenScope(); | 171 ThreadState::current()->leaveGCForbiddenScope(); |
186 } | 172 } |
187 | 173 |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 template<size_t otherCapacity> | 382 template<size_t otherCapacity> |
397 HeapDeque(const HeapDeque<T, otherCapacity>& other) | 383 HeapDeque(const HeapDeque<T, otherCapacity>& other) |
398 : Deque<T, inlineCapacity, HeapAllocator>(other) | 384 : Deque<T, inlineCapacity, HeapAllocator>(other) |
399 { | 385 { |
400 } | 386 } |
401 }; | 387 }; |
402 | 388 |
403 } // namespace blink | 389 } // namespace blink |
404 | 390 |
405 #endif | 391 #endif |
OLD | NEW |