From 1d8d361976a42961e2895ec43ed0718d6c6527d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Inf=C3=BChr?= Date: Thu, 15 Dec 2022 09:34:23 +0100 Subject: [PATCH] [heap] Update limits in MemoryAllocator::TakeOverLargePage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When taking over large pages from another heap, allocated limits in MemoryAllocator need to updated as well. Bug: v8:13267, chromium:1401077 Change-Id: I2ef349578de34ff697a5fa76da17870fa171df95 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4108649 Commit-Queue: Dominik Inführ Reviewed-by: Michael Lippautz Cr-Commit-Position: refs/heads/main@{#84859} --- src/heap/memory-allocator.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/heap/memory-allocator.cc b/src/heap/memory-allocator.cc index 3ab82e2b6c..9cc186ae6d 100644 --- a/src/heap/memory-allocator.cc +++ b/src/heap/memory-allocator.cc @@ -485,6 +485,10 @@ void MemoryAllocator::TakeOverLargePage(LargePage* page, size_ += page->size(); RecordLargePageCreated(*page); + + const size_t area_end_page_aligned = + ::RoundUp(page->area_end(), GetCommitPageSize()); + UpdateAllocatedSpaceLimits(page->address(), area_end_page_aligned); } void MemoryAllocator::FreeReadOnlyPage(ReadOnlyPage* chunk) {