From b0c7bd0f476ea01986c143fc36c5351f67b9817b Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 3 Sep 2021 12:11:35 +0200 Subject: [PATCH] fix(vm) Fix the memory_grow test on Windows (with a bigger page guard) --- lib/api/src/sys/tunables.rs | 8 +++++++- tests/ignores.txt | 3 --- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/api/src/sys/tunables.rs b/lib/api/src/sys/tunables.rs index 39a86ef6fd1..f9343ed2f00 100644 --- a/lib/api/src/sys/tunables.rs +++ b/lib/api/src/sys/tunables.rs @@ -52,13 +52,19 @@ impl BaseTunables { // Allocate a small guard to optimize common cases but without // wasting too much memory. + // The Windows memory manager seems more laxed than the other ones + // And a guard of just 1 page may not be enough is some borderline cases + // So using 2 pages for guard on this plateform + #[cfg(target_os = "windows")] + let dynamic_memory_offset_guard_size: u64 = 0x2_0000; + #[cfg(not(target_os = "windows"))] let dynamic_memory_offset_guard_size: u64 = 0x1_0000; if let OperatingSystem::Windows = triple.operating_system { // For now, use a smaller footprint on Windows so that we don't // outstrip the paging file. static_memory_bound = min(static_memory_bound, 0x100.into()); - static_memory_offset_guard_size = min(static_memory_offset_guard_size, 0x10000); + static_memory_offset_guard_size = min(static_memory_offset_guard_size, 0x20000); } Self { diff --git a/tests/ignores.txt b/tests/ignores.txt index e02ce8b74c9..d27db75caa5 100644 --- a/tests/ignores.txt +++ b/tests/ignores.txt @@ -35,9 +35,6 @@ cranelift multi_value_imports::dylib singlepass multi_value_imports::dylib singlepass multi_value_imports::dynamic -# Memory load doesn't trap as expected when out out bounds in Windows -windows+cranelift spec::memory_grow - # LLVM/Universal doesn't work in macOS M1. Skip all tests llvm+universal+macos+aarch64 *