Index: src/spaces.h |
=================================================================== |
--- src/spaces.h (revision 3088) |
+++ src/spaces.h (working copy) |
@@ -862,6 +862,10 @@ |
// Current capacity without growing (Size() + Available() + Waste()). |
int Capacity() { return accounting_stats_.Capacity(); } |
+ // Total amount of memory committed for this space. For paged |
+ // spaces this equals the capacity. |
+ int CommittedMemory() { return Capacity(); } |
+ |
// Available bytes without growing. |
int Available() { return accounting_stats_.Available(); } |
@@ -1252,11 +1256,19 @@ |
// Return the allocated bytes in the active semispace. |
virtual int Size() { return top() - bottom(); } |
+ |
// Return the current capacity of a semispace. |
int Capacity() { |
ASSERT(to_space_.Capacity() == from_space_.Capacity()); |
return to_space_.Capacity(); |
} |
+ |
+ // Return the total amount of memory committed for new space. |
+ int CommittedMemory() { |
+ if (from_space_.is_committed()) return 2 * Capacity(); |
+ return Capacity(); |
+ } |
+ |
// Return the available bytes without growing in the active semispace. |
int Available() { return Capacity() - Size(); } |