OLD | NEW |
---|---|
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_ALLOCATION_H_ | 5 #ifndef VM_ALLOCATION_H_ |
6 #define VM_ALLOCATION_H_ | 6 #define VM_ALLOCATION_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/base_isolate.h" | 9 #include "vm/base_isolate.h" |
10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 // operator to be public. | 127 // operator to be public. |
128 | 128 |
129 // Disallow explicit deallocation of nodes. Nodes can only be | 129 // Disallow explicit deallocation of nodes. Nodes can only be |
130 // deallocated by invoking DeleteAll() on the zone they live in. | 130 // deallocated by invoking DeleteAll() on the zone they live in. |
131 void operator delete(void* pointer) { UNREACHABLE(); } | 131 void operator delete(void* pointer) { UNREACHABLE(); } |
132 | 132 |
133 private: | 133 private: |
134 DISALLOW_COPY_AND_ASSIGN(ZoneAllocated); | 134 DISALLOW_COPY_AND_ASSIGN(ZoneAllocated); |
135 }; | 135 }; |
136 | 136 |
137 | |
138 | |
139 // Within a NoSafepointScope, the thread must not reach any safepoint. Used | |
140 // around code that manipulates raw object pointers directly without handles. | |
141 #if defined(DEBUG) | |
142 class NoSafepointScope : public StackResource { | |
143 public: | |
144 NoSafepointScope(); | |
145 ~NoSafepointScope(); | |
146 private: | |
Cutch
2015/08/13 16:08:21
The implementation of this class should move from
koda
2015/08/13 19:58:53
Done. Thanks!
| |
147 DISALLOW_COPY_AND_ASSIGN(NoSafepointScope); | |
148 }; | |
149 #else // defined(DEBUG) | |
150 class NoSafepointScope : public ValueObject { | |
151 public: | |
152 NoSafepointScope() {} | |
153 private: | |
154 DISALLOW_COPY_AND_ASSIGN(NoSafepointScope); | |
155 }; | |
156 #endif // defined(DEBUG) | |
157 | |
137 } // namespace dart | 158 } // namespace dart |
138 | 159 |
139 #endif // VM_ALLOCATION_H_ | 160 #endif // VM_ALLOCATION_H_ |
OLD | NEW |