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

Unified Diff: src/heap/heap.cc

Issue 1314543014: [heap] Prevent leakage of GCCallbacksScope outside of heap. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-remove-alloc-failure-scope
Patch Set: Created 5 years, 3 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 | « src/heap/heap.h ('k') | src/heap/heap-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index f1b8c474a81c486a816d500dd88870a336b0c2da..0e954ea059bfe266c1ba56cd7d573c6483cdda68 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -747,6 +747,20 @@ void Heap::PreprocessStackTraces() {
}
+class GCCallbacksScope {
+ public:
+ explicit GCCallbacksScope(Heap* heap) : heap_(heap) {
+ heap_->gc_callbacks_depth_++;
+ }
+ ~GCCallbacksScope() { heap_->gc_callbacks_depth_--; }
+
+ bool CheckReenter() { return heap_->gc_callbacks_depth_ == 1; }
+
+ private:
+ Heap* heap_;
+};
+
+
void Heap::HandleGCRequest() {
if (incremental_marking()->request_type() ==
IncrementalMarking::COMPLETE_MARKING) {
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698