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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! # Mod-MMap
//!
//! `membase` is a high-performance memory mapping library designed for extreme efficiency.
//! It provides cross-platform memory mapping with advanced features like huge page support,
//! NUMA awareness, and SIMD-optimized operations.
//!
//! ## Features
//!
//! - Zero-copy memory mapping with minimal overhead
//! - Cross-platform support (Linux, macOS, Windows)
//! - Huge page support for improved TLB efficiency
//! - NUMA-aware memory allocation
//! - Prefetching optimizations for sequential access
//! - Thread-safe operations with minimal synchronization
//! - Comprehensive error handling with detailed diagnostics
//!
//! ## Example
//!
//! ```
//! use membase::{MmapOptions, Mmap};
//! use std::fs::File;
//! use std::io::Write;
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Create a temporary file
//! let mut file = tempfile::tempfile()?;
//!
//! // Write some data to the file
//! file.write_all(b"Hello, Mod-MMap!")?;
//! file.sync_all()?;
//!
//! // Create a memory map with default options
//! let map = unsafe { MmapOptions::new().map(&file)? };
//!
//! // Access the memory map
//! if map.len() >= 8 {
//! let value = unsafe { *(map.as_ptr() as *const u64) };
//! println!("First 8 bytes as u64: {}", value);
//! }
//! # Ok(())
//! # }
//! ```
pub use ;
pub use ;
pub use ;
/// Version information
pub const VERSION: &str = env!;
/// Feature detection at runtime
/// Check if NUMA is available on this system
/// Check if SIMD acceleration is available