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

Unified Diff: src/vm/object_memory.h

Issue 1263043007: Add ImmutableHeap class consisting of parts (Closed) Base URL: git@github.com:dart-lang/fletch.git@master
Patch Set: Addressed comments, merged other CL about allocation budget in space Created 5 years, 4 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
Index: src/vm/object_memory.h
diff --git a/src/vm/object_memory.h b/src/vm/object_memory.h
index dd2187a8da191390f2107b339d7c980eea9ffe01..3d1f8bfc5870688f9615d58e44700002738952d3 100644
--- a/src/vm/object_memory.h
+++ b/src/vm/object_memory.h
@@ -72,6 +72,8 @@ class Chunk {
// Space is a chain of chunks. It supports allocation and traversal.
class Space {
public:
+ static const int kDefaultChunkSize = 128 * KB;
+
explicit Space(int maximum_initial_size = 0);
~Space();
@@ -111,6 +113,8 @@ class Space {
// Adjust the allocation budget based on the current heap size.
void AdjustAllocationBudget();
+ void SetAllocationBudget(int new_budget);
+
// Tells whether garbage collection is needed.
bool needs_garbage_collection() { return allocation_budget_ <= 0; }
@@ -132,8 +136,6 @@ class Space {
private:
friend class NoAllocationFailureScope;
- static const int kDefaultChunkSize = 128 * KB;
-
uword TryAllocate(int size);
uword AllocateInNewChunk(int size);
« src/vm/immutable_heap.h ('K') | « src/vm/immutable_heap.cc ('k') | src/vm/object_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698