| Index: src/spaces.h
|
| ===================================================================
|
| --- src/spaces.h (revision 2677)
|
| +++ src/spaces.h (working copy)
|
| @@ -367,6 +367,13 @@
|
| // and false otherwise.
|
| static bool CommitBlock(Address start, size_t size, Executability executable);
|
|
|
| +
|
| + // Uncommit a contiguous block of memory [start..(start+size)[.
|
| + // start is not NULL, the size is greater than zero, and the
|
| + // block is contained in the initial chunk. Returns true if it succeeded
|
| + // and false otherwise.
|
| + static bool UncommitBlock(Address start, size_t size);
|
| +
|
| // Attempts to allocate the requested (non-zero) number of pages from the
|
| // OS. Fewer pages might be allocated than requested. If it fails to
|
| // allocate memory for the OS or cannot allocate a single page, this
|
| @@ -1035,6 +1042,10 @@
|
| return 0;
|
| }
|
|
|
| + bool is_committed() { return committed_; }
|
| + bool Commit();
|
| + bool Uncommit();
|
| +
|
| #ifdef DEBUG
|
| virtual void Print();
|
| virtual void Verify();
|
| @@ -1058,6 +1069,8 @@
|
| uintptr_t object_mask_;
|
| uintptr_t object_expected_;
|
|
|
| + bool committed_;
|
| +
|
| public:
|
| TRACK_MEMORY("SemiSpace")
|
| };
|
| @@ -1250,6 +1263,17 @@
|
| void RecordPromotion(HeapObject* obj);
|
| #endif
|
|
|
| + // Return whether the operation succeded.
|
| + bool CommitFromSpaceIfNeeded() {
|
| + if (from_space_.is_committed()) return true;
|
| + return from_space_.Commit();
|
| + }
|
| +
|
| + bool UncommitFromSpace() {
|
| + if (!from_space_.is_committed()) return true;
|
| + return from_space_.Uncommit();
|
| + }
|
| +
|
| private:
|
| // The current and maximum capacities of a semispace.
|
| int capacity_;
|
|
|