Skip to content
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
7 changes: 7 additions & 0 deletions .buildkite/custom-tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
"test_name": "miri",
"command": "RUST_BACKTRACE=1 MIRIFLAGS='-Zmiri-disable-isolation -Zmiri-backtrace=full' cargo +nightly miri test --features backend-mmap,backend-bitmap",
"platform": ["x86_64", "aarch64"]
},
{
"test_name": "check-windows-build",
"command": "printf '\ndenylist=[\"rawfd\", \"xen\"]' >> Cargo.toml; RUSTFLAGS=\"-D warnings\" cargo all-features check --all-targets --target x86_64-pc-windows-gnu",
"platform": [
"x86_64"
]
}
]
}
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ autobenches = false

[features]
default = ["rawfd"]
backend-bitmap = ["dep:libc"]
backend-bitmap = ["dep:libc", "dep:winapi"]
backend-mmap = ["dep:libc", "dep:winapi"]
backend-atomic = ["arc-swap"]
rawfd = ["dep:libc"]
Expand Down
2 changes: 1 addition & 1 deletion src/bitmap/backend/atomic_bitmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ impl NewBitmap for AtomicBitmap {

#[cfg(target_family = "windows")]
let page_size = {
use winapi::um::sysinfoapi::{GetSystemInfo, LPSYSTEM_INFO, SYSTEM_INFO};
use winapi::um::sysinfoapi::GetSystemInfo;
let mut sysinfo = std::mem::MaybeUninit::zeroed();
// SAFETY: It's safe to call `GetSystemInfo` as `sysinfo` is rightly sized
// allocated memory.
Expand Down
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
#[cfg(not(target_pointer_width = "64"))]
compile_error!("vm-memory only supports 64-bit targets!");

#[cfg(all(target_family = "windows", feature = "rawfd"))]
compile_error!("rawfd feature is not supported on Windows targets!");

#[cfg(all(target_family = "windows", feature = "xen"))]
compile_error!("xen feature is not supported on Windows targets!");

#[macro_use]
pub mod address;
pub use address::{Address, AddressValue};
Expand Down
2 changes: 2 additions & 0 deletions src/mmap/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ impl<B> Drop for MmapRegion<B> {
mod tests {
use std::os::windows::io::FromRawHandle;

#[cfg(feature = "backend-bitmap")]
use crate::bitmap::AtomicBitmap;
use crate::guest_memory::FileOffset;
use crate::mmap::windows::INVALID_HANDLE_VALUE;
Expand All @@ -260,6 +261,7 @@ mod tests {
}

#[test]
#[cfg(feature = "backend-bitmap")]
fn test_dirty_tracking() {
// Using the `crate` prefix because we aliased `MmapRegion` to `MmapRegion<()>` for
// the rest of the unit tests above.
Expand Down