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

Unified Diff: src/heap/spaces.cc

Issue 1068833002: More robust when allocation fails during compaction (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/mark-compact.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.cc
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index d372083a4a63aee1e48dbc4a18950a9ffa79e39e..d60faa0a6678cf4279a2b2dab847c7ec4d46c899 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -1164,6 +1164,11 @@ void PagedSpace::FreeEmergencyMemory() {
void PagedSpace::UseEmergencyMemory() {
+ // Page::Initialize makes the chunk into a real page and adds it to the
+ // accounting for this space. Unlike PagedSpace::Expand, we don't check
+ // CanExpand first, so we can go over the limits a little here. That's OK,
+ // because we are in the process of compacting which will free up at least as
+ // much memory as it allocates.
Page* page = Page::Initialize(heap(), emergency_memory_, executable(), this);
page->InsertAfter(anchor_.prev_page());
emergency_memory_ = NULL;
« no previous file with comments | « src/heap/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698