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

Unified Diff: src/spaces.h

Issue 165448: - Added simple memory reduction behavior for IdleNotification.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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
« no previous file with comments | « src/heap.cc ('k') | src/v8.cc » ('j') | src/v8.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.h
===================================================================
--- src/spaces.h (revision 2676)
+++ 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 that the
Mads Ager (chromium) 2009/08/13 12:00:56 and that the -> 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_;
« no previous file with comments | « src/heap.cc ('k') | src/v8.cc » ('j') | src/v8.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698