Chromium Code Reviews| 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: |
|
Cutch
2015/08/13 16:08:21
The implementation of this class should move from
koda
2015/08/13 19:58:53
Done. Thanks!
|
| + 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_ |