Unreviewed changes
4 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: src/base/platform/platform-fuchsia.cc
Insertions: 3, Deletions: 3.
@@ -146,12 +146,12 @@
}
void* TrimMapping(const zx::vmar& vmar, void* base_address, size_t base_length,
- size_t trim_length, size_t alignment) {
+ size_t target_length, size_t alignment) {
uintptr_t base = reinterpret_cast<uintptr_t>(base_address);
uintptr_t new_base = (base + alignment - 1) & ~(alignment - 1);
DCHECK_GE(new_base, base);
size_t pre_slack = new_base - base;
- size_t post_slack = base_length - pre_slack - trim_length;
+ size_t post_slack = base_length - pre_slack - target_length;
DCHECK_LE(pre_slack, base_length);
DCHECK_LE(post_slack, base_length);
@@ -159,7 +159,7 @@
vmar.unmap(base, pre_slack);
}
if (post_slack) {
- vmar.unmap(new_base + trim_length, post_slack);
+ vmar.unmap(new_base + target_length, post_slack);
}
return reinterpret_cast<void*>(new_base);
}
```
Change information
Commit message:
[base] Implement over-reservation in OS::Allocate on Fuchsia
This CL implements over-reservation logic in CreateAndMapVmo (used by
OS::Allocate) to support memory allocations with alignment larger than
4GB (e.g. 32GB for CppGC Cage). Fuchsia's VMAR mapping does not support
alignment > 4GB natively. We overallocate (size + alignment), map it,
find the aligned address, and unmap the head and tail.
Bug: 454026468
Change-Id: I319452e7779826557d208507fec8ee33a6ad0fb4
Cr-Commit-Position: refs/heads/main@{#104990}
Files:
- M src/base/platform/platform-fuchsia.cc
- M src/heap/cppgc/caged-heap.cc
Change size: M
Delta: 2 files changed, 52 insertions(+), 7 deletions(-)
Branch: refs/heads/main
Submit Requirements:
Code-Review: +1 by Michael Lippautz