File tree Expand file tree Collapse file tree 4 files changed +34
-0
lines changed Expand file tree Collapse file tree 4 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 50
50
51
51
- name : Test libmimalloc-sys crate bindings (no secure)
52
52
run : cargo run -p libmimalloc-sys-test
53
+
54
+ - name : Build (extended)
55
+ run : cargo build --features extended
56
+
57
+ - name : Test (extended)
58
+ run : cargo test --features extended
59
+
60
+ - name : Test libmimalloc-sys crate bindings (extended)
61
+ run : cargo run --features extended -p libmimalloc-sys-test
53
62
54
63
lint :
55
64
name : Rustfmt / Clippy
Original file line number Diff line number Diff line change @@ -31,3 +31,4 @@ debug = ["libmimalloc-sys/debug"]
31
31
debug_in_debug = [" libmimalloc-sys/debug_in_debug" ]
32
32
local_dynamic_tls = [" libmimalloc-sys/local_dynamic_tls" ]
33
33
no_thp = [" libmimalloc-sys/no_thp" ]
34
+ extended = [" libmimalloc-sys/extended" ]
Original file line number Diff line number Diff line change
1
+ use crate :: MiMalloc ;
2
+
3
+ impl MiMalloc {
4
+ /// Get the mimalloc version.
5
+ ///
6
+ /// For mimalloc version 1.8.6, this will return 186.
7
+ pub fn version ( & self ) -> u32 {
8
+ unsafe { ffi:: mi_version ( ) as u32 }
9
+ }
10
+ }
11
+
12
+ #[ cfg( test) ]
13
+ mod test {
14
+ use super :: * ;
15
+
16
+ #[ test]
17
+ fn it_gets_version ( ) {
18
+ let version = MiMalloc . version ( ) ;
19
+ assert ! ( version != 0 ) ;
20
+ }
21
+ }
Original file line number Diff line number Diff line change 25
25
26
26
extern crate libmimalloc_sys as ffi;
27
27
28
+ #[ cfg( feature = "extended" ) ]
29
+ mod extended;
30
+
28
31
use core:: alloc:: { GlobalAlloc , Layout } ;
29
32
use core:: ffi:: c_void;
30
33
use ffi:: * ;
You can’t perform that action at this time.
0 commit comments