From 3a8450294385d2dd0a54c955caf7faf35d48f71a Mon Sep 17 00:00:00 2001 From: BlackDex Date: Sat, 25 Jun 2022 15:24:17 +0200 Subject: [PATCH 01/21] Fix CI and update extended.rs Fixed CI by updating extended.rs. Also made sure the correct checks are done during the workflow. Added a run of `libmimalloc-sys-test` for both secure and no secure. --- .github/workflows/ci.yml | 17 ++-- libmimalloc-sys/src/extended.rs | 139 ++++++++++++++++++---------- libmimalloc-sys/sys-test/Cargo.toml | 2 +- libmimalloc-sys/sys-test/build.rs | 2 +- 4 files changed, 101 insertions(+), 59 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 790ad8e..6b97d35 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v1 + uses: actions/checkout@v3 with: submodules: recursive @@ -44,7 +44,12 @@ jobs: uses: actions-rs/cargo@v1 with: command: test - args: --no-default-features + + - name: Test libmimalloc-sys crate bindings (secure) + uses: actions-rs/cargo@v1 + with: + command: run + args: -p libmimalloc-sys-test - name: Build (no secure) uses: actions-rs/cargo@v1 @@ -58,18 +63,18 @@ jobs: command: test args: --no-default-features - - name: Test libmimalloc-sys crate bindings. + - name: Test libmimalloc-sys crate bindings (no secure) uses: actions-rs/cargo@v1 with: command: run - args: -p libmimalloc-sys-test + args: --no-default-features -p libmimalloc-sys-test lint: name: Rustfmt / Clippy runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 with: submodules: recursive @@ -97,7 +102,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: recursive diff --git a/libmimalloc-sys/src/extended.rs b/libmimalloc-sys/src/extended.rs index 1647166..52860ba 100644 --- a/libmimalloc-sys/src/extended.rs +++ b/libmimalloc-sys/src/extended.rs @@ -469,25 +469,27 @@ pub type mi_option_t = c_int; // show_errors reversed as of 1.6.3, however what I have here is correct: // https://github.com/microsoft/mimalloc/issues/266#issuecomment-653822341 -/// Option allowing printing error messages to stderr. +/// Print error messages to `stderr`. pub const mi_option_show_errors: mi_option_t = 0; -/// Option allowing printing statistics to stderr when the program is done. +/// Print statistics to `stderr` when the program is done. pub const mi_option_show_stats: mi_option_t = 1; -/// Option allowing printing verbose messages to stderr. +/// Print verbose messages to `stderr`. pub const mi_option_verbose: mi_option_t = 2; -/// Option (experimental) specifying eagerly commit segments (4MiB) (enabled by default). -pub const mi_option_eager_commit: mi_option_t = 3; +/// ### The following options are experimental +/// ### Deprecated options are kept for binary backward compatibility with v1.x versions -/// Option (experimental) specifying eagerly commit large (256MiB) memory regions (enabled by default, except on Windows). -pub const mi_option_eager_region_commit: mi_option_t = 4; +/// Option (experimental) Eagerly commit segments (4MiB) (enabled by default). +pub const mi_option_eager_commit: mi_option_t = 3; -/// Experimental -pub const mi_option_reset_decommits: mi_option_t = 5; +/// Option Deprecated +pub const mi_option_deprecated_eager_region_commit: mi_option_t = 4; +/// Option Deprecated +pub const mi_option_deprecated_reset_decommits: mi_option_t = 5; -/// Option (experimental) to use large OS pages (2MiB in size) if possible. +/// Option (experimental) Use large OS pages (2MiB in size) if possible. /// /// Use large OS pages (2MiB) when available; for some workloads this can /// significantly improve performance. Use mi_option_verbose to check if @@ -499,7 +501,7 @@ pub const mi_option_reset_decommits: mi_option_t = 5; /// instead whenever possible). pub const mi_option_large_os_pages: mi_option_t = 6; -/// Option (experimental) specifying number of huge OS pages (1GiB in size) to reserve at the start of the program. +/// Option (experimental) The number of huge OS pages (1GiB in size) to reserve at the start of the program. /// /// This reserves the huge pages at startup and sometimes this can give a large (latency) performance /// improvement on big workloads. Usually it is better to not use MIMALLOC_LARGE_OS_PAGES in @@ -512,13 +514,20 @@ pub const mi_option_large_os_pages: mi_option_t = 6; /// allocate just a little to take up space in the huge OS page area (which cannot be reset). pub const mi_option_reserve_huge_os_pages: mi_option_t = 7; -/// TODO: update later -pub const mi_option_reserve_os_memory: mi_option_t = 8; +/// Option (experimental) Reserve huge OS pages at node N. +/// +/// The huge pages are usually allocated evenly among NUMA nodes. +/// You can use mi_option_reserve_huge_os_pages_at=N where `N` is the numa node (starting at 0) to allocate all +/// the huge pages at a specific numa node instead. +pub const mi_option_reserve_huge_os_pages_at: mi_option_t = 8; -/// Option (experimental) specifying number of segments per thread to keep cached. -pub const mi_option_segment_cache: mi_option_t = 9; +/// Option (experimental) Reserve specified amount of OS memory at startup, e.g. "1g" or "512m". +pub const mi_option_reserve_os_memory: mi_option_t = 9; -/// Option (experimental) to reset page memory after mi_option_reset_delay milliseconds when it becomes free. +/// Option Deprecated +pub const mi_option_deprecated_segment_cache: mi_option_t = 10; + +/// Option (experimental) Reset page memory after a mi_option_reset_delay milliseconds when it becomes free. /// /// By default, mimalloc will reset (or purge) OS pages that are not in use, to signal to the OS /// that the underlying physical memory can be reused. This can reduce memory fragmentation in @@ -528,40 +537,49 @@ pub const mi_option_segment_cache: mi_option_t = 9; /// off completely. /// /// Default: 1 (true) -pub const mi_option_page_reset: mi_option_t = 10; +pub const mi_option_page_reset: mi_option_t = 11; -/// Experimental -pub const mi_option_abandoned_page_reset: mi_option_t = 11; +/// Option (experimental) +pub const mi_option_abandoned_page_decommit: mi_option_t = 12; -/// Experimental -pub const mi_option_segment_reset: mi_option_t = 12; +// Option (experimental) +pub const mi_option_deprecated_segment_reset: mi_option_t = 13; -/// Experimental -pub const mi_option_eager_commit_delay: mi_option_t = 13; +/// Option (experimental) the first N segments per thread are not eagerly committed (=1). +pub const mi_option_eager_commit_delay: mi_option_t = 14; -/// Option (experimental) specifying delay in milli-seconds before resetting a page (100ms by default). -pub const mi_option_reset_delay: mi_option_t = 14; +/// Option (experimental) Decommit page memory after N milli-seconds delay (25ms). +pub const mi_option_decommit_delay: mi_option_t = 15; -/// Option (experimental) to pretend there are at most N NUMA nodes. -/// -/// If not set, the actual NUMA nodes are detected at runtime. Setting N to 1 may avoid -/// problems in some virtual environments. Also, setting it to a lower number than the -/// actual NUMA nodes is fine and will only cause threads to potentially allocate more -/// memory across actual NUMA nodes (but this can happen in any case as NUMA local -/// allocation is always a best effort but not guaranteed). -pub const mi_option_use_numa_nodes: mi_option_t = 15; +/// Option (experimental) Pretend there are at most N NUMA nodes; Use 0 to use the actual detected NUMA nodes at runtime. +pub const mi_option_use_numa_nodes: mi_option_t = 16; + +/// Option (experimental) If set to 1, do not use OS memory for allocation (but only pre-reserved arenas) +pub const mi_option_limit_os_alloc: mi_option_t = 17; + +/// Option (experimental) OS tag to assign to mimalloc'd memory +pub const mi_option_os_tag: mi_option_t = 18; + +/// Option (experimental) +pub const mi_option_max_errors: mi_option_t = 19; + +/// Option (experimental) +pub const mi_option_max_warnings: mi_option_t = 20; -/// TODO: update later -pub const mi_option_limit_os_alloc: mi_option_t = 16; +/// Option (experimental) +pub const mi_option_max_segment_reclaim: mi_option_t = 21; -/// Option (experimental) specifying OS tag to assign to mimalloc'd memory. -pub const mi_option_os_tag: mi_option_t = 17; +/// Option (experimental) Enable decommitting memory (=on) +pub const mi_option_allow_decommit: mi_option_t = 22; -/// Experimental -pub const mi_option_max_errors: mi_option_t = 18; +/// Option (experimental) Decommit large segment memory after N milli-seconds delay (500ms). +pub const mi_option_segment_decommit_delay: mi_option_t = 23; -/// Experimental -pub const mi_option_max_warnings: mi_option_t = 19; +/// Option (experimental) +pub const mi_option_decommit_extend_delay: mi_option_t = 24; + +/// Last option. +pub const _mi_option_last: mi_option_t = 25; extern "C" { // Note: mi_option_{enable,disable} aren't exposed because they're redundant @@ -670,6 +688,8 @@ pub struct mi_heap_area_t { pub used: usize, /// Size in bytes of one block. pub block_size: usize, + /// Size in bytes of a full block including padding and metadata. + pub full_block_size: usize, } /// Visitor function passed to [`mi_heap_visit_blocks`] @@ -970,17 +990,34 @@ mod tests { use super::*; #[test] - fn runtime_option_page_reset() { + fn runtime_option_decommit() { + unsafe { + // decommit slices when no longer used (after decommit_delay milli-seconds) (default 1) + assert_eq!(mi_option_get(mi_option_allow_decommit), 1); + mi_option_set(mi_option_allow_decommit, 0); + assert_eq!(mi_option_get(mi_option_allow_decommit), 0); + + // page decommit delay in milli-seconds (default 25) + assert_eq!(mi_option_get(mi_option_decommit_delay), 25); + mi_option_set(mi_option_decommit_delay, 100); + assert_eq!(mi_option_get(mi_option_decommit_delay), 100); + } + } + + #[test] + fn runtime_stable_option() { unsafe { - // page reset - assert_eq!(mi_option_get(mi_option_page_reset), 1); - mi_option_set(mi_option_page_reset, 2); - assert_eq!(mi_option_get(mi_option_page_reset), 2); - - // page reset delay - assert_eq!(mi_option_get(mi_option_reset_delay), 100); - mi_option_set(mi_option_reset_delay, 10_000); - assert_eq!(mi_option_get(mi_option_reset_delay), 10_000); + assert_eq!(mi_option_get(mi_option_show_errors), 0); + mi_option_set(mi_option_show_errors, 1); + assert_eq!(mi_option_get(mi_option_show_errors), 1); + + assert_eq!(mi_option_get(mi_option_show_stats), 0); + mi_option_set(mi_option_show_stats, 1); + assert_eq!(mi_option_get(mi_option_show_stats), 1); + + assert_eq!(mi_option_get(mi_option_verbose), 0); + mi_option_set(mi_option_verbose, 1); + assert_eq!(mi_option_get(mi_option_verbose), 1); } } } diff --git a/libmimalloc-sys/sys-test/Cargo.toml b/libmimalloc-sys/sys-test/Cargo.toml index 19c47a6..89fb748 100644 --- a/libmimalloc-sys/sys-test/Cargo.toml +++ b/libmimalloc-sys/sys-test/Cargo.toml @@ -12,4 +12,4 @@ libmimalloc-sys = { path = "..", features = ["extended"] } libc = "0.2" [build-dependencies] -ctest = "0.2" +ctest2 = "0.4" diff --git a/libmimalloc-sys/sys-test/build.rs b/libmimalloc-sys/sys-test/build.rs index aad27a1..5aabf83 100644 --- a/libmimalloc-sys/sys-test/build.rs +++ b/libmimalloc-sys/sys-test/build.rs @@ -1,5 +1,5 @@ fn main() { - let mut cfg = ctest::TestGenerator::new(); + let mut cfg = ctest2::TestGenerator::new(); cfg.header("mimalloc.h") .include(concat!( env!("CARGO_MANIFEST_DIR"), From 37235f0d517dd622046a24dc784569f1eea04ab7 Mon Sep 17 00:00:00 2001 From: Octavian Oncescu Date: Thu, 13 Oct 2022 15:23:31 +0200 Subject: [PATCH 02/21] v0.1.30 release --- .gitignore | 3 ++- Cargo.toml | 4 ++-- libmimalloc-sys/Cargo.toml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 2f88dba..cb3fa2e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target **/*.rs.bk -Cargo.lock \ No newline at end of file +Cargo.lock +.DS_Store \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index d4e0b73..1b6413e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mimalloc" -version = "0.1.29" +version = "0.1.30" 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.25", default-features = false } +libmimalloc-sys = { path = "libmimalloc-sys", version = "0.1.26", default-features = false } [features] default = ["secure"] diff --git a/libmimalloc-sys/Cargo.toml b/libmimalloc-sys/Cargo.toml index 48018a0..0d27959 100644 --- a/libmimalloc-sys/Cargo.toml +++ b/libmimalloc-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libmimalloc-sys" -version = "0.1.25" +version = "0.1.26" authors = ["Octavian Oncescu "] edition = "2018" repository = "https://github.com/purpleprotocol/mimalloc_rust/tree/master/libmimalloc-sys" From 3a94859e21e6dcaa78684f6bcc57e5d8252b63df Mon Sep 17 00:00:00 2001 From: Octavian Oncescu Date: Tue, 8 Nov 2022 13:40:54 +0100 Subject: [PATCH 03/21] v0.1.31 release --- Cargo.toml | 4 ++-- libmimalloc-sys/Cargo.toml | 2 +- libmimalloc-sys/c_src/mimalloc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1b6413e..bde3122 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mimalloc" -version = "0.1.30" +version = "0.1.31" 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.26", default-features = false } +libmimalloc-sys = { path = "libmimalloc-sys", version = "0.1.27", default-features = false } [features] default = ["secure"] diff --git a/libmimalloc-sys/Cargo.toml b/libmimalloc-sys/Cargo.toml index 0d27959..019da27 100644 --- a/libmimalloc-sys/Cargo.toml +++ b/libmimalloc-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libmimalloc-sys" -version = "0.1.26" +version = "0.1.27" authors = ["Octavian Oncescu "] edition = "2018" repository = "https://github.com/purpleprotocol/mimalloc_rust/tree/master/libmimalloc-sys" diff --git a/libmimalloc-sys/c_src/mimalloc b/libmimalloc-sys/c_src/mimalloc index f2712f4..c7d4a09 160000 --- a/libmimalloc-sys/c_src/mimalloc +++ b/libmimalloc-sys/c_src/mimalloc @@ -1 +1 @@ -Subproject commit f2712f4a8f038a7fb4df2790f4c3b7e3ed9e219b +Subproject commit c7d4a099d918dab466a90fdad5795d8ff6d47aa0 From fb83571a7b90e73e66a28591856bf553281e2575 Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Mon, 14 Nov 2022 19:35:05 -0800 Subject: [PATCH 04/21] Add `libc` to mimalloc-sys --- libmimalloc-sys/Cargo.toml | 1 + libmimalloc-sys/src/lib.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/libmimalloc-sys/Cargo.toml b/libmimalloc-sys/Cargo.toml index 019da27..3337bab 100644 --- a/libmimalloc-sys/Cargo.toml +++ b/libmimalloc-sys/Cargo.toml @@ -12,6 +12,7 @@ links = "mimalloc" [dependencies] cty = { version = "0.2", optional = true } +libc = "0.2" [build-dependencies] cc = "1.0" diff --git a/libmimalloc-sys/src/lib.rs b/libmimalloc-sys/src/lib.rs index e9d8027..ae9c550 100644 --- a/libmimalloc-sys/src/lib.rs +++ b/libmimalloc-sys/src/lib.rs @@ -3,6 +3,8 @@ use core::ffi::c_void; +extern crate libc; + #[cfg(feature = "extended")] mod extended; #[cfg(feature = "extended")] From 76fbd4f98ff4f6ccfa2410b1c33910de76d2c5e6 Mon Sep 17 00:00:00 2001 From: Octavian Oncescu Date: Tue, 15 Nov 2022 22:34:23 +0100 Subject: [PATCH 05/21] v0.1.32 --- Cargo.toml | 4 ++-- libmimalloc-sys/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bde3122..745aaf0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mimalloc" -version = "0.1.31" +version = "0.1.32" 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.27", default-features = false } +libmimalloc-sys = { path = "libmimalloc-sys", version = "0.1.28", default-features = false } [features] default = ["secure"] diff --git a/libmimalloc-sys/Cargo.toml b/libmimalloc-sys/Cargo.toml index 3337bab..c6f018c 100644 --- a/libmimalloc-sys/Cargo.toml +++ b/libmimalloc-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libmimalloc-sys" -version = "0.1.27" +version = "0.1.28" authors = ["Octavian Oncescu "] edition = "2018" repository = "https://github.com/purpleprotocol/mimalloc_rust/tree/master/libmimalloc-sys" From 6d4d9c6f34cc1e21de3aabe7a6f98e75e24899aa Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Wed, 4 Jan 2023 16:46:13 -0600 Subject: [PATCH 06/21] Add license text to libmimalloc-sys crate Link the LICENSE.txt from the main project to the system crate. This allows `cargo package` to bundle it up into the crate, as required for distribution packaging. Signed-off-by: Michel Alexandre Salim --- libmimalloc-sys/LICENSE.txt | 1 + 1 file changed, 1 insertion(+) create mode 120000 libmimalloc-sys/LICENSE.txt diff --git a/libmimalloc-sys/LICENSE.txt b/libmimalloc-sys/LICENSE.txt new file mode 120000 index 0000000..4ab4373 --- /dev/null +++ b/libmimalloc-sys/LICENSE.txt @@ -0,0 +1 @@ +../LICENSE.txt \ No newline at end of file From 7f0a5c1c349e65c50b1cd4cae3a444f9d8432c5b Mon Sep 17 00:00:00 2001 From: Octavian Oncescu Date: Sat, 7 Jan 2023 19:46:20 +0100 Subject: [PATCH 07/21] v0.1.33 release --- Cargo.toml | 4 ++-- libmimalloc-sys/Cargo.toml | 2 +- libmimalloc-sys/c_src/mimalloc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 745aaf0..becf3de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mimalloc" -version = "0.1.32" +version = "0.1.33" 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.28", default-features = false } +libmimalloc-sys = { path = "libmimalloc-sys", version = "0.1.29", default-features = false } [features] default = ["secure"] diff --git a/libmimalloc-sys/Cargo.toml b/libmimalloc-sys/Cargo.toml index c6f018c..cd1ab04 100644 --- a/libmimalloc-sys/Cargo.toml +++ b/libmimalloc-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libmimalloc-sys" -version = "0.1.28" +version = "0.1.29" authors = ["Octavian Oncescu "] edition = "2018" repository = "https://github.com/purpleprotocol/mimalloc_rust/tree/master/libmimalloc-sys" diff --git a/libmimalloc-sys/c_src/mimalloc b/libmimalloc-sys/c_src/mimalloc index c7d4a09..dd73480 160000 --- a/libmimalloc-sys/c_src/mimalloc +++ b/libmimalloc-sys/c_src/mimalloc @@ -1 +1 @@ -Subproject commit c7d4a099d918dab466a90fdad5795d8ff6d47aa0 +Subproject commit dd7348066fe40e8bf372fa4e9538910a5e24a75f From ce634b5770db173d3f318fbf7eabaae8d5486d4c Mon Sep 17 00:00:00 2001 From: Octavian Oncescu Date: Sat, 7 Jan 2023 20:03:29 +0100 Subject: [PATCH 08/21] Fix _mi_last_option --- libmimalloc-sys/src/extended.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmimalloc-sys/src/extended.rs b/libmimalloc-sys/src/extended.rs index 52860ba..3796359 100644 --- a/libmimalloc-sys/src/extended.rs +++ b/libmimalloc-sys/src/extended.rs @@ -579,7 +579,7 @@ pub const mi_option_segment_decommit_delay: mi_option_t = 23; pub const mi_option_decommit_extend_delay: mi_option_t = 24; /// Last option. -pub const _mi_option_last: mi_option_t = 25; +pub const _mi_option_last: mi_option_t = 26; extern "C" { // Note: mi_option_{enable,disable} aren't exposed because they're redundant From bd030f8fe56ddfefcfc7de8a843d34eb0cfe7a92 Mon Sep 17 00:00:00 2001 From: Octavian Oncescu Date: Sat, 7 Jan 2023 20:04:25 +0100 Subject: [PATCH 09/21] v0.1.34 --- Cargo.toml | 4 ++-- libmimalloc-sys/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index becf3de..2199d13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mimalloc" -version = "0.1.33" +version = "0.1.34" 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.29", default-features = false } +libmimalloc-sys = { path = "libmimalloc-sys", version = "0.1.30", default-features = false } [features] default = ["secure"] diff --git a/libmimalloc-sys/Cargo.toml b/libmimalloc-sys/Cargo.toml index cd1ab04..4951cef 100644 --- a/libmimalloc-sys/Cargo.toml +++ b/libmimalloc-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libmimalloc-sys" -version = "0.1.29" +version = "0.1.30" authors = ["Octavian Oncescu "] edition = "2018" repository = "https://github.com/purpleprotocol/mimalloc_rust/tree/master/libmimalloc-sys" From cfac6fa706025e5174ae12c63691fd4d8e2e3220 Mon Sep 17 00:00:00 2001 From: Octavian Oncescu Date: Sat, 1 Apr 2023 12:26:25 +0200 Subject: [PATCH 10/21] Update upstream --- libmimalloc-sys/c_src/mimalloc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmimalloc-sys/c_src/mimalloc b/libmimalloc-sys/c_src/mimalloc index dd73480..acdd352 160000 --- a/libmimalloc-sys/c_src/mimalloc +++ b/libmimalloc-sys/c_src/mimalloc @@ -1 +1 @@ -Subproject commit dd7348066fe40e8bf372fa4e9538910a5e24a75f +Subproject commit acdd35290eced36725d8e961bd64d534bf4a97b6 From 6e095f8a3703fdebd0967735575b6bc4660a74ea Mon Sep 17 00:00:00 2001 From: Octavian Oncescu Date: Sat, 1 Apr 2023 12:31:16 +0200 Subject: [PATCH 11/21] v0.1.35 --- Cargo.toml | 4 ++-- libmimalloc-sys/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2199d13..76da8e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mimalloc" -version = "0.1.34" +version = "0.1.35" 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.30", default-features = false } +libmimalloc-sys = { path = "libmimalloc-sys", version = "0.1.31", default-features = false } [features] default = ["secure"] diff --git a/libmimalloc-sys/Cargo.toml b/libmimalloc-sys/Cargo.toml index 4951cef..1cbb8e9 100644 --- a/libmimalloc-sys/Cargo.toml +++ b/libmimalloc-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libmimalloc-sys" -version = "0.1.30" +version = "0.1.31" authors = ["Octavian Oncescu "] edition = "2018" repository = "https://github.com/purpleprotocol/mimalloc_rust/tree/master/libmimalloc-sys" From d55d781e3cfa53188dca326a6606067c4200aff5 Mon Sep 17 00:00:00 2001 From: Octavian Oncescu Date: Tue, 4 Apr 2023 09:48:34 +0200 Subject: [PATCH 12/21] v0.1.36 --- Cargo.toml | 4 ++-- libmimalloc-sys/Cargo.toml | 2 +- libmimalloc-sys/c_src/mimalloc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 76da8e8..adba70c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mimalloc" -version = "0.1.35" +version = "0.1.36" 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.31", default-features = false } +libmimalloc-sys = { path = "libmimalloc-sys", version = "0.1.32", default-features = false } [features] default = ["secure"] diff --git a/libmimalloc-sys/Cargo.toml b/libmimalloc-sys/Cargo.toml index 1cbb8e9..52c3e51 100644 --- a/libmimalloc-sys/Cargo.toml +++ b/libmimalloc-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libmimalloc-sys" -version = "0.1.31" +version = "0.1.32" authors = ["Octavian Oncescu "] edition = "2018" repository = "https://github.com/purpleprotocol/mimalloc_rust/tree/master/libmimalloc-sys" diff --git a/libmimalloc-sys/c_src/mimalloc b/libmimalloc-sys/c_src/mimalloc index acdd352..5ac9e36 160000 --- a/libmimalloc-sys/c_src/mimalloc +++ b/libmimalloc-sys/c_src/mimalloc @@ -1 +1 @@ -Subproject commit acdd35290eced36725d8e961bd64d534bf4a97b6 +Subproject commit 5ac9e36ed6ed8e5d33f95f733c3a7fbeb9211a7c From 934a2fb453705a7c7b42890ba36f665bed5e53d6 Mon Sep 17 00:00:00 2001 From: Octavian Oncescu Date: Tue, 25 Apr 2023 21:57:28 +0200 Subject: [PATCH 13/21] v0.1.37 --- Cargo.toml | 4 ++-- libmimalloc-sys/Cargo.toml | 2 +- libmimalloc-sys/c_src/mimalloc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index adba70c..929f0ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mimalloc" -version = "0.1.36" +version = "0.1.37" 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.32", default-features = false } +libmimalloc-sys = { path = "libmimalloc-sys", version = "0.1.33", default-features = false } [features] default = ["secure"] diff --git a/libmimalloc-sys/Cargo.toml b/libmimalloc-sys/Cargo.toml index 52c3e51..62e5557 100644 --- a/libmimalloc-sys/Cargo.toml +++ b/libmimalloc-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libmimalloc-sys" -version = "0.1.32" +version = "0.1.33" authors = ["Octavian Oncescu "] edition = "2018" repository = "https://github.com/purpleprotocol/mimalloc_rust/tree/master/libmimalloc-sys" diff --git a/libmimalloc-sys/c_src/mimalloc b/libmimalloc-sys/c_src/mimalloc index 5ac9e36..2cbf68b 160000 --- a/libmimalloc-sys/c_src/mimalloc +++ b/libmimalloc-sys/c_src/mimalloc @@ -1 +1 @@ -Subproject commit 5ac9e36ed6ed8e5d33f95f733c3a7fbeb9211a7c +Subproject commit 2cbf68b5e74ac00c585a48c5b82dff6b87fbf9e3 From ec6b98da1671e70bc6ef69bb0031ddc52893e810 Mon Sep 17 00:00:00 2001 From: Octavian Oncescu Date: Fri, 25 Aug 2023 14:41:09 +0200 Subject: [PATCH 14/21] Remove broken experimental extended mode definitions + remove secure mode as default feature --- .travis.yml | 48 --------------------------- Cargo.toml | 2 +- README.md | 8 ++--- libmimalloc-sys/src/extended.rs | 57 --------------------------------- 4 files changed, 5 insertions(+), 110 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 175b46c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,48 +0,0 @@ -language: rust - -sudo: required - -rust: - - stable - - beta - - nightly - -os: - - windows - - linux - - osx - -dist: xenial - -matrix: - allow_failures: - - rust: nightly - - os: windows - -addons: - apt: - packages: - - cmake - - gcc - -language: rust - -cache: cargo - -before_script: - # Remove sh.exe from the path otherwise CMake will complain: - # "sh.exe was found in your PATH, here: C:/Program Files/Git/usr/bin/sh.exe" - # and the MinGW build will not work (the Visual Studio build does not care). - # See http://help.appveyor.com/discussions/problems/3193-cmake-building-for-mingw-issue-with-git-shexe - # The entire directory containing sh.exe could be removed from the PATH environment: - # - set PATH=%PATH:C:\Program Files\Git\usr\bin;=% - # However, this will also remove all other programs in this directory from the PATH. - # In particular "patch" is still required. - # So, just rename sh.exe: - - if [ "$TRAVIS_OS_NAME" = "windows" ]; then mv "C:\Program Files\Git\usr\bin\sh.exe" "C:\Program Files\Git\usr\bin\_sh.exe" ; fi - -script: - - cargo test --verbose --all - - cargo test --verbose --all --no-default-features - - cargo test --release --verbose --all - - cargo test --release --verbose --all --no-default-features diff --git a/Cargo.toml b/Cargo.toml index 929f0ce..c688801 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ travis-ci = { repository = "purpleprotocol/mimalloc_rust" } libmimalloc-sys = { path = "libmimalloc-sys", version = "0.1.33", default-features = false } [features] -default = ["secure"] +default = [] secure = ["libmimalloc-sys/secure"] override = ["libmimalloc-sys/override"] debug = ["libmimalloc-sys/debug"] diff --git a/README.md b/README.md index 03891c1..b920c3a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Mimalloc Rust -[![Build Status](https://travis-ci.org/purpleprotocol/mimalloc_rust.svg?branch=master)](https://travis-ci.org/purpleprotocol/mimalloc_rust) [![Latest Version]][crates.io] [![Documentation]][docs.rs] +[![Latest Version]][crates.io] [![Documentation]][docs.rs] A drop-in global allocator wrapper around the [mimalloc](https://github.com/microsoft/mimalloc) allocator. Mimalloc is a general purpose, performance oriented allocator built by Microsoft. @@ -18,9 +18,9 @@ static GLOBAL: MiMalloc = MiMalloc; A __C__ compiler is required for building [mimalloc](https://github.com/microsoft/mimalloc) with cargo. -## Usage without secure mode +## Usage with secure mode -By default this library builds mimalloc in secure mode. This add guard pages, +Using secure mode adds guard pages, randomized allocation, encrypted free lists, etc. The performance penalty is usually around 10% according to [mimalloc](https://github.com/microsoft/mimalloc) own benchmarks. @@ -29,7 +29,7 @@ To disable secure mode, put in `Cargo.toml`: ```ini [dependencies] -mimalloc = { version = "*", default-features = false } +mimalloc = { version = "*", features = ["secure"] } ``` [crates.io]: https://crates.io/crates/mimalloc diff --git a/libmimalloc-sys/src/extended.rs b/libmimalloc-sys/src/extended.rs index 3796359..f290048 100644 --- a/libmimalloc-sys/src/extended.rs +++ b/libmimalloc-sys/src/extended.rs @@ -479,15 +479,6 @@ pub const mi_option_show_stats: mi_option_t = 1; pub const mi_option_verbose: mi_option_t = 2; /// ### The following options are experimental -/// ### Deprecated options are kept for binary backward compatibility with v1.x versions - -/// Option (experimental) Eagerly commit segments (4MiB) (enabled by default). -pub const mi_option_eager_commit: mi_option_t = 3; - -/// Option Deprecated -pub const mi_option_deprecated_eager_region_commit: mi_option_t = 4; -/// Option Deprecated -pub const mi_option_deprecated_reset_decommits: mi_option_t = 5; /// Option (experimental) Use large OS pages (2MiB in size) if possible. /// @@ -524,33 +515,9 @@ pub const mi_option_reserve_huge_os_pages_at: mi_option_t = 8; /// Option (experimental) Reserve specified amount of OS memory at startup, e.g. "1g" or "512m". pub const mi_option_reserve_os_memory: mi_option_t = 9; -/// Option Deprecated -pub const mi_option_deprecated_segment_cache: mi_option_t = 10; - -/// Option (experimental) Reset page memory after a mi_option_reset_delay milliseconds when it becomes free. -/// -/// By default, mimalloc will reset (or purge) OS pages that are not in use, to signal to the OS -/// that the underlying physical memory can be reused. This can reduce memory fragmentation in -/// long running (server) programs. By setting it to 0 this will no longer be done which can improve -/// performance for batch-like programs. As an alternative, the mi_option_reset_delay= can be set -/// higher (100ms by default) to make the page reset occur less frequently instead of turning it -/// off completely. -/// -/// Default: 1 (true) -pub const mi_option_page_reset: mi_option_t = 11; - -/// Option (experimental) -pub const mi_option_abandoned_page_decommit: mi_option_t = 12; - -// Option (experimental) -pub const mi_option_deprecated_segment_reset: mi_option_t = 13; - /// Option (experimental) the first N segments per thread are not eagerly committed (=1). pub const mi_option_eager_commit_delay: mi_option_t = 14; -/// Option (experimental) Decommit page memory after N milli-seconds delay (25ms). -pub const mi_option_decommit_delay: mi_option_t = 15; - /// Option (experimental) Pretend there are at most N NUMA nodes; Use 0 to use the actual detected NUMA nodes at runtime. pub const mi_option_use_numa_nodes: mi_option_t = 16; @@ -569,15 +536,6 @@ pub const mi_option_max_warnings: mi_option_t = 20; /// Option (experimental) pub const mi_option_max_segment_reclaim: mi_option_t = 21; -/// Option (experimental) Enable decommitting memory (=on) -pub const mi_option_allow_decommit: mi_option_t = 22; - -/// Option (experimental) Decommit large segment memory after N milli-seconds delay (500ms). -pub const mi_option_segment_decommit_delay: mi_option_t = 23; - -/// Option (experimental) -pub const mi_option_decommit_extend_delay: mi_option_t = 24; - /// Last option. pub const _mi_option_last: mi_option_t = 26; @@ -989,21 +947,6 @@ extern "C" { mod tests { use super::*; - #[test] - fn runtime_option_decommit() { - unsafe { - // decommit slices when no longer used (after decommit_delay milli-seconds) (default 1) - assert_eq!(mi_option_get(mi_option_allow_decommit), 1); - mi_option_set(mi_option_allow_decommit, 0); - assert_eq!(mi_option_get(mi_option_allow_decommit), 0); - - // page decommit delay in milli-seconds (default 25) - assert_eq!(mi_option_get(mi_option_decommit_delay), 25); - mi_option_set(mi_option_decommit_delay, 100); - assert_eq!(mi_option_get(mi_option_decommit_delay), 100); - } - } - #[test] fn runtime_stable_option() { unsafe { From 14eb45cee4c45d36e56707b3e5b0f7c0be5944e6 Mon Sep 17 00:00:00 2001 From: Octavian Oncescu Date: Fri, 25 Aug 2023 14:44:35 +0200 Subject: [PATCH 15/21] v0.1.38 --- Cargo.toml | 4 ++-- README.md | 2 +- libmimalloc-sys/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c688801..c8510cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mimalloc" -version = "0.1.37" +version = "0.1.38" 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.33", default-features = false } +libmimalloc-sys = { path = "libmimalloc-sys", version = "0.1.34", default-features = false } [features] default = [] diff --git a/README.md b/README.md index b920c3a..cdb9030 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ randomized allocation, encrypted free lists, etc. The performance penalty is usu around 10% according to [mimalloc](https://github.com/microsoft/mimalloc) own benchmarks. -To disable secure mode, put in `Cargo.toml`: +To enable secure mode, put in `Cargo.toml`: ```ini [dependencies] diff --git a/libmimalloc-sys/Cargo.toml b/libmimalloc-sys/Cargo.toml index 62e5557..d1347d8 100644 --- a/libmimalloc-sys/Cargo.toml +++ b/libmimalloc-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libmimalloc-sys" -version = "0.1.33" +version = "0.1.34" authors = ["Octavian Oncescu "] edition = "2018" repository = "https://github.com/purpleprotocol/mimalloc_rust/tree/master/libmimalloc-sys" From d118cc8332a3804ec67de9fe4501c72bb38190b8 Mon Sep 17 00:00:00 2001 From: Jake Shadle Date: Thu, 31 Aug 2023 07:15:02 +0200 Subject: [PATCH 16/21] Remove unnecessary files --- libmimalloc-sys/Cargo.toml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libmimalloc-sys/Cargo.toml b/libmimalloc-sys/Cargo.toml index d1347d8..58266f4 100644 --- a/libmimalloc-sys/Cargo.toml +++ b/libmimalloc-sys/Cargo.toml @@ -9,6 +9,14 @@ categories = ["memory-management", "api-bindings"] description = "Sys crate wrapping the mimalloc allocator" license = "MIT" links = "mimalloc" +exclude = [ + "/c_src/mimalloc/bin", + "/c_src/mimalloc/cmake", + "/c_src/mimalloc/doc", + "/c_src/mimalloc/docs", + "/c_src/mimalloc/ide", + "/c_src/mimalloc/test", +] [dependencies] cty = { version = "0.2", optional = true } From 8b579ccd96b26f44a43117cbec227bdc69b3fa2b Mon Sep 17 00:00:00 2001 From: Nathaniel Daniel Date: Tue, 12 Sep 2023 16:20:19 -0700 Subject: [PATCH 17/21] Remove `may_use_unaligned_api` --- src/lib.rs | 45 +++------------------------------------------ 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 891f70e..a60fe99 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,33 +29,6 @@ use core::alloc::{GlobalAlloc, Layout}; use core::ffi::c_void; use ffi::*; -// `MI_MAX_ALIGN_SIZE` is 16 unless manually overridden: -// https://github.com/microsoft/mimalloc/blob/15220c68/include/mimalloc-types.h#L22 -// -// If it changes on us, we should consider either manually overriding it, or -// expose it from the -sys crate (in order to catch updates) -const MI_MAX_ALIGN_SIZE: usize = 16; - -// Note: this doesn't take a layout directly because doing so would be wrong for -// reallocation -#[inline] -fn may_use_unaligned_api(size: usize, alignment: usize) -> bool { - // Required by `GlobalAlloc`. Note that while allocators aren't allowed to - // unwind in rust, this is only in debug mode, and can only happen if the - // caller already caused UB by passing in an invalid layout. - debug_assert!(size != 0 && alignment.is_power_of_two()); - - // This logic is based on the discussion [here]. We don't bother with the - // 3rd suggested test due to it being high cost (calling `mi_good_size`) - // compared to the other checks, and also feeling like it relies on too much - // implementation-specific behavior. - // - // [here]: https://github.com/microsoft/mimalloc/issues/314#issuecomment-708541845 - - (alignment <= MI_MAX_ALIGN_SIZE && size >= alignment) - || (alignment == size && alignment <= 4096) -} - /// Drop-in mimalloc global allocator. /// /// ## Usage @@ -70,20 +43,12 @@ pub struct MiMalloc; unsafe impl GlobalAlloc for MiMalloc { #[inline] unsafe fn alloc(&self, layout: Layout) -> *mut u8 { - if may_use_unaligned_api(layout.size(), layout.align()) { - mi_malloc(layout.size()) as *mut u8 - } else { - mi_malloc_aligned(layout.size(), layout.align()) as *mut u8 - } + mi_malloc_aligned(layout.size(), layout.align()) as *mut u8 } #[inline] unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 { - if may_use_unaligned_api(layout.size(), layout.align()) { - mi_zalloc(layout.size()) as *mut u8 - } else { - mi_zalloc_aligned(layout.size(), layout.align()) as *mut u8 - } + mi_zalloc_aligned(layout.size(), layout.align()) as *mut u8 } #[inline] @@ -93,11 +58,7 @@ unsafe impl GlobalAlloc for MiMalloc { #[inline] unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 { - if may_use_unaligned_api(new_size, layout.align()) { - mi_realloc(ptr as *mut c_void, new_size) as *mut u8 - } else { - mi_realloc_aligned(ptr as *mut c_void, new_size, layout.align()) as *mut u8 - } + mi_realloc_aligned(ptr as *mut c_void, new_size, layout.align()) as *mut u8 } } From cc34ec1831fb0b422730394fe9bd435791ec1745 Mon Sep 17 00:00:00 2001 From: Nathaniel Daniel Date: Wed, 13 Sep 2023 18:44:40 -0700 Subject: [PATCH 18/21] Replace actions-rs actions --- .github/workflows/ci.yml | 62 +++++++++------------------------------- 1 file changed, 13 insertions(+), 49 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b97d35..f704a1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,45 +29,27 @@ jobs: submodules: recursive - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.toolchain }} - profile: minimal - default: true - name: Build (secure) - uses: actions-rs/cargo@v1 - with: - command: build + run: cargo build - name: Test (secure) - uses: actions-rs/cargo@v1 - with: - command: test + run: cargo test - name: Test libmimalloc-sys crate bindings (secure) - uses: actions-rs/cargo@v1 - with: - command: run - args: -p libmimalloc-sys-test + run: cargo run -p libmimalloc-sys-test - name: Build (no secure) - uses: actions-rs/cargo@v1 - with: - command: build - args: --no-default-features + run: cargo build --no-default-features - name: Test (no secure) - uses: actions-rs/cargo@v1 - with: - command: test - args: --no-default-features + run: cargo test --no-default-features - name: Test libmimalloc-sys crate bindings (no secure) - uses: actions-rs/cargo@v1 - with: - command: run - args: --no-default-features -p libmimalloc-sys-test + run: cargo run --no-default-features -p libmimalloc-sys-test lint: name: Rustfmt / Clippy @@ -78,23 +60,15 @@ jobs: with: submodules: recursive - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@stable with: - profile: minimal - toolchain: stable components: rustfmt, clippy - name: Fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + run: cargo fmt --all -- --check - name: Clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --workspace -- -D warnings + run: cargo clippy --workspace -- -D warnings # Detect cases where documentation links would be dead doc: @@ -106,11 +80,7 @@ jobs: with: submodules: recursive - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true + - uses: dtolnay/rust-toolchain@nightly # Note: We need to use nightly rust, and `cargo rustdoc` (yes, not `cargo # doc`) to actually get it to respect -D warnings... Using nightly also @@ -118,13 +88,7 @@ jobs: # what docs.rs uses. - name: 'Check documentation links in `mimalloc`' - uses: actions-rs/cargo@v1 - with: - command: rustdoc - args: -- -D warnings + run: cargo rustdoc -- -D warnings - name: 'Check documentation links in `libmimalloc-sys`' - uses: actions-rs/cargo@v1 - with: - command: rustdoc - args: -p libmimalloc-sys -- -D warnings + run: cargo rustdoc -p libmimalloc-sys -- -D warnings From d8b9efa93eab02b68480e088cfde86ea0768fd7a Mon Sep 17 00:00:00 2001 From: Nathaniel Daniel Date: Wed, 13 Sep 2023 18:47:37 -0700 Subject: [PATCH 19/21] Update actions/checkout@v3 to actions/checkout@v4 --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f704a1b..bee0700 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive @@ -56,7 +56,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive @@ -76,7 +76,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive From 102587da0759a9400f531aef3602294c5c761129 Mon Sep 17 00:00:00 2001 From: Nathaniel Daniel Date: Wed, 13 Sep 2023 18:50:12 -0700 Subject: [PATCH 20/21] Fix CI testing of secure feature --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bee0700..b077a81 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,22 +34,22 @@ jobs: toolchain: ${{ matrix.toolchain }} - name: Build (secure) - run: cargo build + run: cargo build --features secure - name: Test (secure) - run: cargo test + run: cargo test --features secure - name: Test libmimalloc-sys crate bindings (secure) - run: cargo run -p libmimalloc-sys-test + run: cargo run --features secure -p libmimalloc-sys-test - name: Build (no secure) - run: cargo build --no-default-features + run: cargo build - name: Test (no secure) - run: cargo test --no-default-features + run: cargo test - name: Test libmimalloc-sys crate bindings (no secure) - run: cargo run --no-default-features -p libmimalloc-sys-test + run: cargo run -p libmimalloc-sys-test lint: name: Rustfmt / Clippy From 0dc380da37b09c5e11aa6b57022dfdc156d61309 Mon Sep 17 00:00:00 2001 From: Octavian Oncescu Date: Thu, 14 Sep 2023 13:30:34 +0200 Subject: [PATCH 21/21] v0.1.39 --- Cargo.toml | 4 ++-- libmimalloc-sys/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c8510cc..9d05201 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mimalloc" -version = "0.1.38" +version = "0.1.39" 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.34", default-features = false } +libmimalloc-sys = { path = "libmimalloc-sys", version = "0.1.35", default-features = false } [features] default = [] diff --git a/libmimalloc-sys/Cargo.toml b/libmimalloc-sys/Cargo.toml index 58266f4..8180a38 100644 --- a/libmimalloc-sys/Cargo.toml +++ b/libmimalloc-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libmimalloc-sys" -version = "0.1.34" +version = "0.1.35" authors = ["Octavian Oncescu "] edition = "2018" repository = "https://github.com/purpleprotocol/mimalloc_rust/tree/master/libmimalloc-sys"