File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ no_format = [] # Removes string formatting (less detailed errors) for binary siz
1919all_private = [] # No memory mapped files, memory is not shared.
2020size_opt = [" nightly" ]
2121nightly = [] # Optimizations for nightly builds.
22- mmap-rs = [] # Uses mmap-rs for memory mapping. This is auto activated during build.
22+ direct-mmap = [] # If set, uses built-in code for memory mapping. This is auto activated in build.rs for supported platforms .
2323
2424[dependencies ]
2525concat-string = " 1.0.1"
Original file line number Diff line number Diff line change 11fn main ( ) {
22 // This defines a fallback to mmap-rs if one of the explicit memory mapped file implementations
33 // is not available.
4- if ! cfg ! ( any(
4+ if cfg ! ( any(
55 target_os = "macos" ,
66 target_os = "windows" ,
77 target_os = "linux"
88 ) ) {
9- println ! ( "cargo:rustc-cfg=feature=\" mmap-rs \" " ) ;
9+ println ! ( "cargo:rustc-cfg=feature=\" direct-mmap \" " ) ;
1010 }
1111}
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ pub fn allocate(
2222 return crate :: internal:: buffer_allocator_osx:: allocate_osx ( settings) ;
2323
2424 // Fallback for non-hot-path OSes.
25- #[ cfg( feature = "mmap-rs" ) ]
25+ #[ cfg( not ( feature = "direct-mmap" ) ) ]
2626 crate :: internal:: buffer_allocator_mmap_rs:: allocate_mmap_rs ( settings)
2727}
2828
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ impl PrivateAllocation {
168168 }
169169
170170 /// Frees the allocated memory when the `PrivateAllocation` instance is dropped.
171- #[ cfg( feature = "mmap-rs" ) ]
171+ #[ cfg( not ( feature = "direct-mmap" ) ) ]
172172 pub ( crate ) fn drop_mmap_rs ( & mut self ) {
173173 use mmap_rs_with_map_from_existing:: MmapOptions ;
174174 let _map = unsafe {
@@ -196,7 +196,7 @@ impl Drop for PrivateAllocation {
196196 return PrivateAllocation :: drop_macos ( self ) ;
197197
198198 // non-hot-path-os
199- #[ cfg( feature = "mmap-rs" ) ]
199+ #[ cfg( not ( feature = "direct-mmap" ) ) ]
200200 return PrivateAllocation :: drop_mmap_rs ( self ) ;
201201 }
202202}
You can’t perform that action at this time.
0 commit comments