Skip to content

Commit 0ad448f

Browse files
max-ltclaude
andcommitted
fix: disable cppgc caged heap for HermitOS
On x64, cppgc_enable_caged_heap defaults to true, which enables CPPGC_POINTER_COMPRESSION and requires a 48 GB virtual memory reservation (2×16 GB + 16 GB alignment). HermitOS has no demand paging, so this reservation cannot be satisfied — V8 either OOMs or corrupts memory when the allocation is capped. Disable the caged heap for Hermit so V8 uses regular allocations for Oilpan objects instead. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent ce8c540 commit 0ad448f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,10 @@ fn build_v8(is_asan: bool) {
453453
// HermitOS: enable WASM with explicit bounds checks (no signal-based trap handler)
454454
gn_args.push("v8_enable_trap_handler=false".to_string());
455455
gn_args.push("v8_enable_sandbox=false".to_string());
456+
// HermitOS: disable cppgc caged heap — it requires a 48 GB virtual memory
457+
// reservation for pointer compression alignment, which is impossible on a
458+
// unikernel without demand paging.
459+
gn_args.push("cppgc_enable_caged_heap=false".to_string());
456460
gn_args.push("use_sysroot=false".to_string());
457461
// HermitOS: use V8's bundled libc++ (statically linked into librusty_v8.a)
458462
// so consumers don't need to provide a separate C++ stdlib for Hermit.

0 commit comments

Comments
 (0)