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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/allocation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/allocation.h
diff --git a/runtime/vm/allocation.h b/runtime/vm/allocation.h
index 3947f0e79881db294753869df3f3185280f49837..74a2d7d6d17aa85c4dd05d34d3fd9231088e2475 100644
--- a/runtime/vm/allocation.h
+++ b/runtime/vm/allocation.h
@@ -134,6 +134,27 @@ class ZoneAllocated {
DISALLOW_COPY_AND_ASSIGN(ZoneAllocated);
};
+
+
+// Within a NoSafepointScope, the thread must not reach any safepoint. Used
+// around code that manipulates raw object pointers directly without handles.
+#if defined(DEBUG)
+class NoSafepointScope : public StackResource {
+ public:
+ NoSafepointScope();
+ ~NoSafepointScope();
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NoSafepointScope);
+};
+#else // defined(DEBUG)
+class NoSafepointScope : public ValueObject {
+ public:
+ NoSafepointScope() {}
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NoSafepointScope);
+};
+#endif // defined(DEBUG)
+
} // namespace dart
#endif // VM_ALLOCATION_H_
« 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