From 5acfab598eb0099e993e47e251a582b26daef8bc Mon Sep 17 00:00:00 2001 From: Michel Lind Date: Thu, 30 May 2024 23:05:23 -0500 Subject: [PATCH] Update to 0.1.38 (rhbz#2276528) Signed-off-by: Michel Lind --- .gitignore | 1 + libmimalloc-sys-fix-usable-size-gating.diff | 36 +++++++++++++++++++++ rust-libmimalloc-sys.spec | 34 +++++++++++++++++-- series | 1 + sources | 2 +- 5 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 libmimalloc-sys-fix-usable-size-gating.diff create mode 100644 series diff --git a/.gitignore b/.gitignore index 96484b4..882a0ff 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /libmimalloc-sys-0.1.30.crate /libmimalloc-sys-0.1.33.crate /libmimalloc-sys-0.1.35.crate +/libmimalloc-sys-0.1.38.crate diff --git a/libmimalloc-sys-fix-usable-size-gating.diff b/libmimalloc-sys-fix-usable-size-gating.diff new file mode 100644 index 0000000..5cb7eb4 --- /dev/null +++ b/libmimalloc-sys-fix-usable-size-gating.diff @@ -0,0 +1,36 @@ +--- a/src/extended.rs ++++ b/src/extended.rs +@@ -1014,6 +1014,16 @@ 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 { + assert_eq!(mi_option_get(mi_option_show_errors), 0); +--- a/src/lib.rs ++++ b/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" +- ); +- } + } diff --git a/rust-libmimalloc-sys.spec b/rust-libmimalloc-sys.spec index d3ba7ba..d441580 100644 --- a/rust-libmimalloc-sys.spec +++ b/rust-libmimalloc-sys.spec @@ -1,23 +1,27 @@ -# Generated by rust2rpm 25 +# Generated by rust2rpm 26 %bcond_without check %global debug_package %{nil} %global crate libmimalloc-sys Name: rust-libmimalloc-sys -Version: 0.1.35 +Version: 0.1.38 Release: %autorelease Summary: Sys crate wrapping the mimalloc allocator License: MIT URL: https://crates.io/crates/libmimalloc-sys Source: %{crates_source} +# https://github.com/purpleprotocol/mimalloc_rust/pull/122 +Patch: %{crate}-fix-usable-size-gating.diff BuildRequires: cargo-rpm-macros >= 24 # TODO: get this to build against system mimalloc # or ask mimalloc dev to switch to mimalloc-sys -Provides: bundled(mimalloc) = 2.1.2 +# https://github.com/purpleprotocol/mimalloc_rust/issues/73 +# see MI_MALLOC_VERSION in mimalloc/include/mimalloc.h +Provides: bundled(mimalloc) = 2.1.6 %global _description %{expand: Sys crate wrapping the mimalloc allocator.} @@ -50,6 +54,18 @@ use the "default" feature of the "%{crate}" crate. %files -n %{name}+default-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+arena-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+arena-devel %{_description} + +This package contains library source intended for building other packages which +use the "arena" feature of the "%{crate}" crate. + +%files -n %{name}+arena-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+cty-devel Summary: %{summary} BuildArch: noarch @@ -110,6 +126,18 @@ use the "local_dynamic_tls" feature of the "%{crate}" crate. %files -n %{name}+local_dynamic_tls-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+no_thp-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+no_thp-devel %{_description} + +This package contains library source intended for building other packages which +use the "no_thp" feature of the "%{crate}" crate. + +%files -n %{name}+no_thp-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+override-devel Summary: %{summary} BuildArch: noarch diff --git a/series b/series new file mode 100644 index 0000000..24ea452 --- /dev/null +++ b/series @@ -0,0 +1 @@ +libmimalloc-sys-fix-usable-size-gating.diff diff --git a/sources b/sources index 83463e3..22f9bfd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libmimalloc-sys-0.1.35.crate) = 7f9ef551d23d7e22073cf9d8593103a4ca17cf82b65b2bc1404dbfc2cec46c4f305ad9dfda9ca1c61e7ff3a617196c6798f505d62c90552dd25b4ba0c05e5847 +SHA512 (libmimalloc-sys-0.1.38.crate) = 3b0416b06a4692be364b75e324a312e0160f64f8a49930d3e0eb6fb201982b59482f636fca774a254aead6112168acd3d307c2a79c5ce3be3213850c172a7bf9