Index: src/heap/spaces.cc |
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc |
index b31aaf3998fd98a370b3a329dcfb992c12f9e112..2bfb1f251f0ecda12769bf689f94864b44563d71 100644 |
--- a/src/heap/spaces.cc |
+++ b/src/heap/spaces.cc |
@@ -1105,7 +1105,7 @@ bool PagedSpace::HasBeenSetUp() { return true; } |
void PagedSpace::TearDown() { |
for (auto it = begin(); it != end();) { |
Page* page = *(it++); // Will be erased. |
- ArrayBufferTracker::FreeAll(page); |
+ heap()->array_buffer_tracker()->FreeAll(page); |
heap()->memory_allocator()->Free<MemoryAllocator::kFull>(page); |
} |
anchor_.set_next_page(&anchor_); |
@@ -1593,6 +1593,8 @@ void NewSpace::UpdateInlineAllocationLimit(int size_in_bytes) { |
bool NewSpace::AddFreshPage() { |
+ if (heap()->ShouldDoScavengeForReducingExternalMemory()) return false; |
+ |
Address top = allocation_info_.top(); |
DCHECK(!Page::IsAtObjectStart(top)); |
if (!to_space_.AdvancePage()) { |
@@ -1785,7 +1787,7 @@ void SemiSpace::TearDown() { |
// Properly uncommit memory to keep the allocator counters in sync. |
if (is_committed()) { |
for (Page* p : *this) { |
- ArrayBufferTracker::FreeAll(p); |
+ heap()->array_buffer_tracker()->FreeAll(p); |
} |
Uncommit(); |
} |