Index: runtime/vm/allocation.cc |
diff --git a/runtime/vm/allocation.cc b/runtime/vm/allocation.cc |
index 92e288539d8b91aef7d0bb4efba8279d6ff6cb37..b6fda7b8478f61be06d8c2a2687aba0dacac737b 100644 |
--- a/runtime/vm/allocation.cc |
+++ b/runtime/vm/allocation.cc |
@@ -38,4 +38,16 @@ void StackResource::UnwindAbove(Thread* thread, StackResource* new_top) { |
} |
} |
+ |
+#if defined(DEBUG) |
+NoSafepointScope::NoSafepointScope() : StackResource(Thread::Current()) { |
+ thread()->IncrementNoSafepointScopeDepth(); |
+} |
+ |
+ |
+NoSafepointScope::~NoSafepointScope() { |
+ thread()->DecrementNoSafepointScopeDepth(); |
+} |
+#endif // defined(DEBUG) |
+ |
} // namespace dart |