Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: runtime/vm/allocation.h

Issue 1292063004: Add NoSafepointScope to ObjectPointerVisitor. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Move implementation. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/allocation.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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:
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_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/allocation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698