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

Unified Diff: runtime/vm/pages.h

Issue 2363823002: Fix for issue 27380 - VM stuck in deadlock with background finalization and background compiler thr… (Closed)
Patch Set: Created 4 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 | « runtime/vm/heap.cc ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/pages.h
diff --git a/runtime/vm/pages.h b/runtime/vm/pages.h
index 640e771f30036d72e087d96c76f6715efc9689d0..06e3ab5e9d9042c2057d94a55bfef02680dd878d 100644
--- a/runtime/vm/pages.h
+++ b/runtime/vm/pages.h
@@ -412,8 +412,13 @@ class PageSpace {
// Unlimited.
return true;
}
- ASSERT(CapacityInWords() <= max_capacity_in_words_);
- return increase_in_words <= (max_capacity_in_words_ - CapacityInWords());
+ // TODO(issue 27413): Make the check against capacity and the bump
+ // of capacity atomic so that CapacityInWords does not exceed
+ // max_capacity_in_words_.
+ intptr_t free_capacity_in_words =
+ (max_capacity_in_words_ - CapacityInWords());
+ return ((free_capacity_in_words > 0) &&
+ (increase_in_words <= free_capacity_in_words));
}
FreeList freelist_[HeapPage::kNumPageTypes];
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698