Skip to content

Commit fdcea40

Browse files
committed
Move mmap_* modules under src/mmap/
No functional changes, other than the module paths of mmap related types. Signed-off-by: Manos Pitsidianakis <[email protected]>
1 parent a7dab8e commit fdcea40

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

coverage_config_aarch64.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"coverage_score": 85.2,
3-
"exclude_path": "mmap_windows.rs",
3+
"exclude_path": "mmap/windows.rs",
44
"crate_features": "backend-mmap,backend-atomic,backend-bitmap"
55
}

src/lib.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,6 @@ pub use guest_memory::{
5353
pub mod io;
5454
pub use io::{ReadVolatile, WriteVolatile};
5555

56-
#[cfg(all(feature = "backend-mmap", not(feature = "xen"), unix))]
57-
mod mmap_unix;
58-
59-
#[cfg(all(feature = "backend-mmap", feature = "xen", unix))]
60-
mod mmap_xen;
61-
62-
#[cfg(all(feature = "backend-mmap", windows))]
63-
mod mmap_windows;
64-
6556
#[cfg(feature = "backend-mmap")]
6657
pub mod mmap;
6758

src/mmap.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,24 @@ use crate::volatile_memory::{VolatileMemory, VolatileSlice};
2929
use crate::{AtomicAccess, Bytes, ReadVolatile, WriteVolatile};
3030

3131
#[cfg(all(not(feature = "xen"), unix))]
32-
pub use crate::mmap_unix::{Error as MmapRegionError, MmapRegion, MmapRegionBuilder};
32+
mod unix;
3333

3434
#[cfg(all(feature = "xen", unix))]
35-
pub use crate::mmap_xen::{Error as MmapRegionError, MmapRange, MmapRegion, MmapXenFlags};
35+
pub(crate) mod xen;
3636

3737
#[cfg(windows)]
38-
pub use crate::mmap_windows::MmapRegion;
38+
mod windows;
39+
40+
#[cfg(all(not(feature = "xen"), unix))]
41+
pub use unix::{Error as MmapRegionError, MmapRegion, MmapRegionBuilder};
42+
43+
#[cfg(all(feature = "xen", unix))]
44+
pub use xen::{Error as MmapRegionError, MmapRange, MmapRegion, MmapXenFlags};
45+
3946
#[cfg(windows)]
4047
pub use std::io::Error as MmapRegionError;
48+
#[cfg(windows)]
49+
pub use windows::MmapRegion;
4150

4251
/// A `Bitmap` that can be created starting from an initial size.
4352
pub trait NewBitmap: Bitmap + Default {
File renamed without changes.

src/mmap_windows.rs renamed to src/mmap/windows.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ mod tests {
248248

249249
use crate::bitmap::AtomicBitmap;
250250
use crate::guest_memory::FileOffset;
251-
use crate::mmap_windows::INVALID_HANDLE_VALUE;
251+
use crate::mmap::windows::INVALID_HANDLE_VALUE;
252252

253253
type MmapRegion = super::MmapRegion<()>;
254254

File renamed without changes.

src/volatile_memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ use crate::bitmap::{Bitmap, BitmapSlice, BS};
4040
use crate::{AtomicAccess, ByteValued, Bytes};
4141

4242
#[cfg(all(feature = "backend-mmap", feature = "xen", unix))]
43-
use crate::mmap_xen::{MmapXen as MmapInfo, MmapXenSlice};
43+
use crate::mmap::xen::{MmapXen as MmapInfo, MmapXenSlice};
4444

4545
#[cfg(not(feature = "xen"))]
4646
type MmapInfo = std::marker::PhantomData<()>;

0 commit comments

Comments
 (0)