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

Unified Diff: runtime/vm/pages.h

Issue 864843002: Remove default heap size limit and add separate limit for externals. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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/pages.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/pages.h
===================================================================
--- runtime/vm/pages.h (revision 43108)
+++ runtime/vm/pages.h (working copy)
@@ -196,7 +196,9 @@
kForceGrowth
};
- PageSpace(Heap* heap, intptr_t max_capacity_in_words);
+ PageSpace(Heap* heap,
+ intptr_t max_capacity_in_words,
+ intptr_t max_external_in_words);
~PageSpace();
uword TryAllocate(intptr_t size,
@@ -269,7 +271,8 @@
}
bool NeedsExternalGC() const {
- return UsedInWords() + ExternalInWords() > max_capacity_in_words_;
+ return (max_external_in_words_ != 0) &&
+ (ExternalInWords() > max_external_in_words_);
}
// TODO(koda): Unify protection handling.
@@ -382,6 +385,10 @@
static intptr_t LargePageSizeInWordsFor(intptr_t size);
bool CanIncreaseCapacityInWords(intptr_t increase_in_words) {
+ if (max_capacity_in_words_ == 0) {
+ // Unlimited.
+ return true;
+ }
ASSERT(CapacityInWords() <= max_capacity_in_words_);
return increase_in_words <= (max_capacity_in_words_ - CapacityInWords());
}
@@ -405,6 +412,7 @@
// Various sizes being tracked for this generation.
intptr_t max_capacity_in_words_;
+ intptr_t max_external_in_words_;
// NOTE: The capacity component of usage_ is updated by the concurrent
// sweeper. Use (Increase)CapacityInWords(Locked) for thread-safe access.
SpaceUsage usage_;
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/pages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698