Index: runtime/vm/zone.h |
diff --git a/runtime/vm/zone.h b/runtime/vm/zone.h |
index d73398bfe40588de5cf144578152612e4e6889bc..afd62977b35eb4f588a2e1991d30633ba281e96c 100644 |
--- a/runtime/vm/zone.h |
+++ b/runtime/vm/zone.h |
@@ -64,10 +64,10 @@ class Zone { |
// Compute the total size of this zone. This includes wasted space that is |
// due to internal fragmentation in the segments. |
- intptr_t SizeInBytes() const; |
+ uintptr_t SizeInBytes() const; |
// Computes the amount of space used in the zone. |
- intptr_t CapacityInBytes() const; |
+ uintptr_t CapacityInBytes() const; |
// Structure for managing handles allocation. |
VMHandles* handles() { return &handles_; } |
@@ -76,10 +76,6 @@ class Zone { |
Zone* previous() const { return previous_; } |
-#ifndef PRODUCT |
- void PrintJSON(JSONStream* stream) const; |
-#endif |
- |
private: |
Zone(); |
~Zone(); // Delete all memory associated with the zone. |
@@ -99,6 +95,10 @@ class Zone { |
// Zap value used to indicate uninitialized zone area (debug purposes). |
static const unsigned char kZapUninitializedByte = 0xab; |
+ // Zone memory statistic update methods. |
+ void IncrementMemoryCapacity(uintptr_t size); |
+ void DecrementMemoryCapacity(uintptr_t size); |
+ |
// Expand the zone to accommodate an allocation of 'size' bytes. |
uword AllocateExpand(intptr_t size); |
@@ -180,7 +180,7 @@ class StackZone : public StackResource { |
// Compute the total size of this zone. This includes wasted space that is |
// due to internal fragmentation in the segments. |
- intptr_t SizeInBytes() const { return zone_.SizeInBytes(); } |
+ uintptr_t SizeInBytes() const { return zone_.SizeInBytes(); } |
// Computes the used space in the zone. |
intptr_t CapacityInBytes() const { return zone_.CapacityInBytes(); } |
@@ -200,7 +200,6 @@ class StackZone : public StackResource { |
inline uword Zone::AllocUnsafe(intptr_t size) { |
ASSERT(size >= 0); |
- |
// Round up the requested size to fit the alignment. |
if (size > (kIntptrMax - kAlignment)) { |
FATAL1("Zone::Alloc: 'size' is too large: size=%" Pd "", size); |
@@ -252,6 +251,7 @@ inline ElementType* Zone::Realloc(ElementType* old_data, |
reinterpret_cast<uword>(old_data) + (new_len * kElementSize); |
// ...and there is sufficient space. |
if (new_end <= limit_) { |
+ ASSERT(new_len >= old_len); |
position_ = Utils::RoundUp(new_end, kAlignment); |
return old_data; |
} |