Make PageAllocator::DecommitPages mandatory

Besides the virtual memory cage, the DecommitPages API is also now
required for Cppgc with crrev/c/3211583.

A working implementation of this API is availabe in src/base/platform
for all supported platforms and is used by the DefaultPlatform.

Bug: chromium:1218005
Change-Id: I29765993ed54bb52de71998ae8c6295637ee4072
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3211584
Commit-Queue: Samuel Groß <saelo@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77396}
This commit is contained in:
Samuel Groß 2021-10-14 13:38:35 +02:00 committed by V8 LUCI CQ
parent 783e1fde50
commit 7efcab88db
2 changed files with 1 additions and 8 deletions

View File

@ -444,13 +444,7 @@ class PageAllocator {
* zero-initialized again. The memory must have been previously allocated by a
* call to AllocatePages. Returns true on success, false otherwise.
*/
#ifdef V8_VIRTUAL_MEMORY_CAGE
// Implementing this API is required when the virtual memory cage is enabled.
virtual bool DecommitPages(void* address, size_t size) = 0;
#else
// Otherwise, it is optional for now.
virtual bool DecommitPages(void* address, size_t size) { return false; }
#endif
/**
* INTERNAL ONLY: This interface has not been stabilised and may change

View File

@ -15,8 +15,7 @@ namespace base {
// Defines the page initialization mode of a BoundedPageAllocator.
enum class PageInitializationMode {
// The contents of allocated pages must be zero initialized. This causes any
// committed pages to be decommitted during FreePages and ReleasePages. This
// requires the embedder to provide the PageAllocator::DecommitPages API.
// committed pages to be decommitted during FreePages and ReleasePages.
kAllocatedPagesMustBeZeroInitialized,
// Allocated pages do not have to be be zero initialized and can contain old
// data. This is slightly faster as comitted pages are not decommitted