Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vm) Fix the memory_grow test on Windows (with a bigger page guard) #2552

Merged
merged 2 commits into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/api/src/sys/tunables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- plateform
+ platform

:-)

#[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 {
Expand Down
3 changes: 0 additions & 3 deletions tests/ignores.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 *

Expand Down