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

Unified Diff: runtime/vm/pages.cc

Issue 10458072: Force growth when retrying an old-space allocation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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/pages.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/pages.cc
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc
index 965e5b984fce0d1c7aa1b86239d4359b1435eb10..60f26d3e03d03b1b4d3c591fb4844a463cdb5649 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -191,6 +191,11 @@ uword PageSpace::TryBumpAllocate(intptr_t size) {
uword PageSpace::TryAllocate(intptr_t size) {
+ return TryAllocate(size, kControlGrowth);
+}
+
+
+uword PageSpace::TryAllocate(intptr_t size, GrowthPolicy growth_policy) {
ASSERT(size >= kObjectAlignment);
ASSERT(Utils::IsAligned(size, kObjectAlignment));
uword result = 0;
@@ -200,7 +205,7 @@ uword PageSpace::TryAllocate(intptr_t size) {
result = freelist_.TryAllocate(size);
if ((result == 0) &&
(page_space_controller_.CanGrowPageSpace(size) ||
- (size < (capacity() - in_use()))) && // Fragmentation
+ growth_policy == kForceGrowth) &&
CanIncreaseCapacity(kPageSize)) {
AllocatePage();
result = TryBumpAllocate(size);
« no previous file with comments | « runtime/vm/pages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698