Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index 4dcec2750faa7a1f1d3f99c45d58665667fe897b..768d91b6d938a5ee205679b0de0fc4c60e19d090 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -1903,8 +1903,8 @@ |
VerboseAccountingAllocator(Heap* heap, size_t sample_bytes) |
: heap_(heap), last_memory_usage_(0), sample_bytes_(sample_bytes) {} |
- v8::internal::Segment* GetSegment(size_t size) override { |
- v8::internal::Segment* memory = AccountingAllocator::GetSegment(size); |
+ v8::internal::Segment* AllocateSegment(size_t size) override { |
+ v8::internal::Segment* memory = AccountingAllocator::AllocateSegment(size); |
if (memory) { |
size_t current = GetCurrentMemoryUsage(); |
if (last_memory_usage_.Value() + sample_bytes_ < current) { |
@@ -1915,8 +1915,8 @@ |
return memory; |
} |
- void ReturnSegment(v8::internal::Segment* memory) override { |
- AccountingAllocator::ReturnSegment(memory); |
+ void FreeSegment(v8::internal::Segment* memory) override { |
+ AccountingAllocator::FreeSegment(memory); |
size_t current = GetCurrentMemoryUsage(); |
if (current + sample_bytes_ < last_memory_usage_.Value()) { |
PrintJSON(current); |
@@ -2169,6 +2169,9 @@ |
Isolate::~Isolate() { |
TRACE_ISOLATE(destructor); |
+ // Has to be called while counters_ are still alive |
+ runtime_zone_->DeleteKeptSegment(); |
+ |
// The entry stack must be empty when we get here. |
DCHECK(entry_stack_ == NULL || entry_stack_->previous_item == NULL); |