File tree 4 files changed +6
-6
lines changed
4 files changed +6
-6
lines changed 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
19
19
all_private = [] # No memory mapped files, memory is not shared.
20
20
size_opt = [" nightly" ]
21
21
nightly = [] # 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 .
23
23
24
24
[dependencies ]
25
25
concat-string = " 1.0.1"
Original file line number Diff line number Diff line change 1
1
fn main ( ) {
2
2
// This defines a fallback to mmap-rs if one of the explicit memory mapped file implementations
3
3
// is not available.
4
- if ! cfg ! ( any(
4
+ if cfg ! ( any(
5
5
target_os = "macos" ,
6
6
target_os = "windows" ,
7
7
target_os = "linux"
8
8
) ) {
9
- println ! ( "cargo:rustc-cfg=feature=\" mmap-rs \" " ) ;
9
+ println ! ( "cargo:rustc-cfg=feature=\" direct-mmap \" " ) ;
10
10
}
11
11
}
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ pub fn allocate(
22
22
return crate :: internal:: buffer_allocator_osx:: allocate_osx ( settings) ;
23
23
24
24
// Fallback for non-hot-path OSes.
25
- #[ cfg( feature = "mmap-rs" ) ]
25
+ #[ cfg( not ( feature = "direct-mmap" ) ) ]
26
26
crate :: internal:: buffer_allocator_mmap_rs:: allocate_mmap_rs ( settings)
27
27
}
28
28
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ impl PrivateAllocation {
168
168
}
169
169
170
170
/// Frees the allocated memory when the `PrivateAllocation` instance is dropped.
171
- #[ cfg( feature = "mmap-rs" ) ]
171
+ #[ cfg( not ( feature = "direct-mmap" ) ) ]
172
172
pub ( crate ) fn drop_mmap_rs ( & mut self ) {
173
173
use mmap_rs_with_map_from_existing:: MmapOptions ;
174
174
let _map = unsafe {
@@ -196,7 +196,7 @@ impl Drop for PrivateAllocation {
196
196
return PrivateAllocation :: drop_macos ( self ) ;
197
197
198
198
// non-hot-path-os
199
- #[ cfg( feature = "mmap-rs" ) ]
199
+ #[ cfg( not ( feature = "direct-mmap" ) ) ]
200
200
return PrivateAllocation :: drop_mmap_rs ( self ) ;
201
201
}
202
202
}
You can’t perform that action at this time.
0 commit comments