1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! Low-level OS page allocation backend mapping interface.
//!
//! The crate is organized by concern so each leaf owns one backend
//! responsibility:
//!
//! - [`mapping`] owns the [`MemoryBackendWrapper`] struct shape and the
//! single `impl MemoryBackend for MemoryBackendWrapper` block.
//! `allocate` / `deallocate` bodies are inline here; `make_guard`,
//! `page_reset`, and `decommit` delegate into the per-concern helpers
//! in [`guard`] and [`reset`] via `#[inline(always)]` static-dispatch
//! calls.
//! - [`guard`] owns `do_make_guard` — the per-method helper for
//! `PROT_NONE` / `PAGE_NOACCESS` guard-region installation — called
//! by the `make_guard` entry in [`mapping`]'s impl block.
//! - [`reset`] owns `do_page_reset` and `do_decommit` — the per-method
//! helpers for content-discard and commit-charge release — called by
//! the `page_reset` and `decommit` entries in [`mapping`]'s impl block.
//! - [`recorders`] owns the telemetry counters, the
//! [`BackendMemoryStats`] snapshot, and the per-concern unit tests
//! for the `record_*` family.
//! - [`backends`] owns the per-OS / per-platform backend
//! implementations (`UnixBackend`, `WindowsBackend`, and the CUDA variants).
//!
//! Public re-exports at the crate root keep the canonical
//! `mnemosyne_backend::CudaUnifiedBackend`, `MemoryBackendWrapper`,
//! and `backend_memory_stats` paths while backend-specific helpers
//! live under [`backends`].
extern crate alloc;
pub use DefaultBackend;
pub use ;
pub use MemoryBackendWrapper;
pub use ;