diff --git a/benches/benches.rs b/benches/benches.rs index 19ca8ea..682f915 100644 --- a/benches/benches.rs +++ b/benches/benches.rs @@ -32,7 +32,7 @@ fn bench_probe_wdl(bench: &mut Bencher) { }); } -#[cfg(feature = "mmap")] +#[cfg(all(feature = "mmap", target_pointer_width = "64"))] fn bench_probe_wdl_mmap(bench: &mut Bencher) { // Safety: No modifications to table files and I/O errors please. // Fingers crossed. @@ -55,9 +55,9 @@ fn bench_probe_wdl_mmap(bench: &mut Bencher) { }); } -#[cfg(not(feature = "mmap"))] +#[cfg(not(all(feature = "mmap", target_pointer_width = "64")))] benchmark_group!(benches, bench_add_directory, bench_probe_wdl); -#[cfg(feature = "mmap")] +#[cfg(all(feature = "mmap", target_pointer_width = "64"))] benchmark_group!( benches, bench_add_directory, diff --git a/src/tablebase.rs b/src/tablebase.rs index a1ba53e..6a8fae9 100644 --- a/src/tablebase.rs +++ b/src/tablebase.rs @@ -80,7 +80,7 @@ impl Tablebase { /// * Externally guarantee absence of I/O errors (or live with the /// consequences). For example, I/O errors will generate /// `SIGSEV`/`SIGBUS` on Linux. - #[cfg(feature = "mmap")] + #[cfg(all(feature = "mmap", target_pointer_width = "64"))] pub unsafe fn with_mmap_filesystem() -> Tablebase { // Safety: Forwarding contract of memmap2::MmapOptions::map() // to caller. diff --git a/tests/suite.rs b/tests/suite.rs index b1f0cac..06f5268 100644 --- a/tests/suite.rs +++ b/tests/suite.rs @@ -63,7 +63,7 @@ fn test_chess() { test_csv::(Tablebase::new(), "tests/chess.csv"); } -#[cfg(feature = "mmap")] +#[cfg(all(feature = "mmap", target_pointer_width = "64"))] #[test] fn test_chess_mmap() { // Safety: No modifications to table files and I/O errors please.