diff --git a/Cargo.toml b/Cargo.toml index 6101dfa..3fcd504 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mimalloc" -version = "0.1.42" +version = "0.1.43" authors = [ "Octavian Oncescu ", "Vincent Rouillé ", @@ -21,7 +21,7 @@ members = ["libmimalloc-sys", "libmimalloc-sys/sys-test"] travis-ci = { repository = "purpleprotocol/mimalloc_rust" } [dependencies] -libmimalloc-sys = { path = "libmimalloc-sys", version = "0.1.38", default-features = false } +libmimalloc-sys = { path = "libmimalloc-sys", version = "0.1.39", default-features = false } [features] default = [] diff --git a/libmimalloc-sys/Cargo.toml b/libmimalloc-sys/Cargo.toml index 963594a..78269aa 100644 --- a/libmimalloc-sys/Cargo.toml +++ b/libmimalloc-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libmimalloc-sys" -version = "0.1.38" +version = "0.1.39" authors = ["Octavian Oncescu "] edition = "2018" repository = "https://github.com/purpleprotocol/mimalloc_rust/tree/master/libmimalloc-sys" diff --git a/libmimalloc-sys/build.rs b/libmimalloc-sys/build.rs index 50c05c6..748503e 100644 --- a/libmimalloc-sys/build.rs +++ b/libmimalloc-sys/build.rs @@ -57,6 +57,6 @@ fn main() { // on armv6 we need to link with libatomic if target_os == "linux" && target_arch == "arm" { - println!("cargo:rustc-link-lib=dylib=atomic"); + println!("cargo:rustc-link-lib=atomic"); } } diff --git a/libmimalloc-sys/c_src/mimalloc b/libmimalloc-sys/c_src/mimalloc index 6141843..8c532c3 160000 --- a/libmimalloc-sys/c_src/mimalloc +++ b/libmimalloc-sys/c_src/mimalloc @@ -1 +1 @@ -Subproject commit 6141843614220c4d85f55774c131a68ba778e413 +Subproject commit 8c532c32c3c96e5ba1f2283e032f69ead8add00f diff --git a/libmimalloc-sys/src/extended.rs b/libmimalloc-sys/src/extended.rs index 416ff16..db9876f 100644 --- a/libmimalloc-sys/src/extended.rs +++ b/libmimalloc-sys/src/extended.rs @@ -546,7 +546,7 @@ pub const mi_option_max_warnings: mi_option_t = 20; pub const mi_option_max_segment_reclaim: mi_option_t = 21; /// Last option. -pub const _mi_option_last: mi_option_t = 28; +pub const _mi_option_last: mi_option_t = 29; extern "C" { // Note: mi_option_{enable,disable} aren't exposed because they're redundant @@ -1013,6 +1013,16 @@ extern "C" { mod tests { use super::*; + #[test] + fn it_calculates_usable_size() { + let ptr = unsafe { mi_malloc(32) } as *mut u8; + let usable_size = unsafe { mi_usable_size(ptr as *mut c_void) }; + assert!( + usable_size >= 32, + "usable_size should at least equal to the allocated size" + ); + } + #[test] fn runtime_stable_option() { unsafe { diff --git a/libmimalloc-sys/src/lib.rs b/libmimalloc-sys/src/lib.rs index 53721eb..ecc9f3a 100644 --- a/libmimalloc-sys/src/lib.rs +++ b/libmimalloc-sys/src/lib.rs @@ -89,14 +89,4 @@ mod tests { let ptr = unsafe { mi_realloc_aligned(ptr as *mut c_void, 8, 8) } as *mut u8; unsafe { mi_free(ptr as *mut c_void) }; } - - #[test] - fn it_calculates_usable_size() { - let ptr = unsafe { mi_malloc(32) } as *mut u8; - let usable_size = unsafe { mi_usable_size(ptr as *mut c_void) }; - assert!( - usable_size >= 32, - "usable_size should at least equal to the allocated size" - ); - } }