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/Persistent.h" | 9 #include "platform/heap/Persistent.h" |
10 #include "platform/heap/TraceTraits.h" | 10 #include "platform/heap/TraceTraits.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 | 141 |
142 template <typename T> | 142 template <typename T> |
143 static void* NewArray(size_t bytes) { | 143 static void* NewArray(size_t bytes) { |
144 ASSERT_NOT_REACHED(); | 144 ASSERT_NOT_REACHED(); |
145 return 0; | 145 return 0; |
146 } | 146 } |
147 | 147 |
148 static void DeleteArray(void* ptr) { ASSERT_NOT_REACHED(); } | 148 static void DeleteArray(void* ptr) { ASSERT_NOT_REACHED(); } |
149 | 149 |
150 static bool IsAllocationAllowed() { | 150 static bool IsAllocationAllowed() { |
151 return ThreadState::Current()->IsAllocationAllowed(); | 151 return ThreadState::Current()->IsAllocationAllowed() && |
152 !ThreadState::Current()->IsObjectRessurectionForbidden(); | |
haraken
2017/04/12 11:03:37
Hmm, it looks confusing to change the meaning of I
keishi
2017/04/13 05:22:42
I added a separate method on Allocator.
Looks lik
| |
152 } | 153 } |
153 | 154 |
154 template <typename T> | 155 template <typename T> |
155 static bool IsHeapObjectAlive(T* object) { | 156 static bool IsHeapObjectAlive(T* object) { |
156 return ThreadHeap::IsHeapObjectAlive(object); | 157 return ThreadHeap::IsHeapObjectAlive(object); |
157 } | 158 } |
158 | 159 |
159 template <typename VisitorDispatcher> | 160 template <typename VisitorDispatcher> |
160 static void MarkNoTracing(VisitorDispatcher visitor, const void* t) { | 161 static void MarkNoTracing(VisitorDispatcher visitor, const void* t) { |
161 visitor->MarkNoTracing(t); | 162 visitor->MarkNoTracing(t); |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
842 const blink::HeapHashCountedSet<Value, HashFunctions, Traits>& set, | 843 const blink::HeapHashCountedSet<Value, HashFunctions, Traits>& set, |
843 VectorType& vector) { | 844 VectorType& vector) { |
844 CopyToVector(static_cast<const HashCountedSet<Value, HashFunctions, Traits, | 845 CopyToVector(static_cast<const HashCountedSet<Value, HashFunctions, Traits, |
845 blink::HeapAllocator>&>(set), | 846 blink::HeapAllocator>&>(set), |
846 vector); | 847 vector); |
847 } | 848 } |
848 | 849 |
849 } // namespace WTF | 850 } // namespace WTF |
850 | 851 |
851 #endif | 852 #endif |
OLD | NEW |