All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
This is the shared changelog for rustfs-mimalloc-sys, rustfs-mimalloc,
and rustfs-mimalloc-profiling, which share one release version.
rustfs-mimalloc-profiling): the default profiling core no
longer selects an allocator. Install SamplingAllocator<A> around the
application’s GlobalAlloc provider. Both mimalloc::MiMalloc and
rustfs_mimalloc::MiMalloc use the same recorder and pprof implementation.SamplingMiMalloc::new() and Default convenience API
behind the explicit rustfs-allocator feature. Library adapters can depend
on the core with default-features = false.Keep all three crate versions synchronized at 0.7.0 and refresh the locked libc resolution to 0.2.191. The pinned native allocator and ABI are unchanged.
workspace.dependencies; member crates inherit them while retaining their
feature selections and target-platform conditions.libflate requirement from 2.1 to
2.3 and refresh the workspace lockfile, including prost-derive’s
itertools 0.14 resolution.repr(C) layouts, complementing the
function-name/option-ID inventory and runtime linkage tests. Negative
controls reject return-type, callback-constness, layout-order and size-alias
drift. CI runs the checks without adding allocator runtime overhead.dev3 remains 6f45cc52; no new upstream API requires another
source or binding update in this pass.dev3 commit 6f45cc52 (2026-10-16 review), after the
v3.5.4 interim tag. The C source version remains 30504. This includes
allocation/free improvements, adaptive full-page retention, cross-thread page
reclamation, the arena/bitmap source reorganization, and bitmap rollback
fixes through the 2026-10-16 review. Includes naturally aligned allocation
size-class improvements, cache offsets, OS-page heap lifecycle/visiting fixes,
and quiescent fork support. The large-range immediate-purge default is 32 MiB.
Workload-specific throughput and RSS still require measurement.on_snapshot and use
mutable heap pointers in allocation/free callbacks.rust-version from the workspace and member manifests as requested;
retain Rust 1.96.0 as an explicit CI compatibility check, not a Cargo MSRV.rustfs-mimalloc-profiling companion crate, extracted
from grafana/pyroscope-rs#572. It owns the sampling allocator, bounded event
recorder, opt-in live allocation tracking, symbol/mapping resolution and
pprof encoder. Profiler provides an exclusive recording session with explicit
stop and Drop cleanup, returning owned profile bytes without an uploader or
dependency on Pyroscope. The wrapper uses the matching allocator’s
GlobalAlloc interface; direct native allocations are outside its coverage
and bounded recorder pressure can omit samples.Move allocator behavior, optimized profile quality, stress and benchmark validation alongside the profiling implementation. Keep the base allocator dependency graph free of profiling dependencies.
mi_thread_id_of,
mi_heap_set_debug_fill_preserve, mi_theap_delete, and
mi_theap_quiescent_abandon. Added MiMalloc::thread_id_of,
Heap::set_debug_fill_preserve, and unsafe ThreadHeap::quiescent_abandon.
Context deletion remains raw FFI because it invalidates all cached aliases.CFLAGS=-DMI_TRACK_CUSTOM, with no default hot-path overhead.MiMalloc::{expand,rezalloc,rezalloc_aligned}, heap zero-allocation
and reallocation helpers, and cached ThreadHeap::{calloc,malloc_csize,
zalloc_csize,realloc,rezalloc}. Added 13 previously unbound public C
allocation APIs; zero-growth, alignment and overflow behavior are tested.no_profile builds to remove allocation profiling sampling and automatic
MIMALLOC_PROFILE startup. Statistics, alignment, security/debug checks and raw
profiler control ABI remain available; explicit snapshots have no allocation samples.MiMalloc::profiling_enabled() and MI_PROFILE_ENABLED capability queries that
respect the linked sys crate’s unified Cargo features.Heap::thread_local() and borrowed ThreadHeap allocation methods to avoid
repeated TLS lookups when a worker alternates between heaps. The view cannot
outlive its parent or be sent/shared across threads; allocations may still be
freed on other threads. Global allocator and retention defaults are unchanged.mi_register_error, mi_register_output, and
mi_register_deferred_free, with lifetime/concurrency contracts.mi_profiler_snapshot, mi_pprof_profiler_new, and
mi_pprof_profiler_delete; all four profiling interval/sample-rate options.mi_arenas_purge and safe MiMalloc::arenas_purge() to process pending
arena purges in the main subprocess. Expose mi_option_stats_merge_threshold
and mi_option_arena_purge_immediate_size, plus renamed purge/stat-merge
options and compatibility aliases for the prior Rust option names.MiMalloc::free_small_local{,_nonnull} and matching raw FFI. The
allocation’s small page must still be owned by the calling thread.System and
the generic/local small-free paths.Replace interval-crossing loops and their deterministic fallback with one memoryless sampling step. Keep the unsampled path to a TLS countdown and use a FIFO TLS ring so partial drains do not move retained stacks.
Inherit upstream Windows console detachment, ProcessPrng/legacy RNG loading, naturally aligned allocation, direct-OS-page cleanup, and inline-linkage fixes. Upstream #1428 adds array-reallocation contract tests.
src/theap.c to src/heap/theap.c.__ImageBase with explicit extern in C builds. Upstream’s
C++ linkage macro expands to nothing in C and accidentally defined BSS storage,
shadowing the linker-owned PE base. Static UCRT used that false base for RVA
lookups and crashed in __acrt_tls2_supported before main. Verify the symbol
matches the OS module handle and the PE header in the isolated startup test.mi_malloc_size and
mi_malloc_usable_size available even without malloc override; test their
actual linkage and values.mi_free_size size-mismatch checks, Windows
forced-exit handling and UWP compilation, Android syscall avoidance, and
profiling-disabled builds. Keep the built-in pprof implementation enabled in
no_profile so explicit raw snapshots remain functional..CRT$XCT, after UCRT initialization. Keep
weak seeds for early allocation bootstrap and TLS thread-exit cleanup.+crt-static from -crt-static and honor encoded Rust flags.main in an isolated regression
executable, including secure/debug/no-profile and release CI coverage.MI_MALLOC_OVERRIDE on non-Windows override builds.MI_DEFAULT_ALLOW_THP=0 with no_thp; disabling only explicit huge-page
advice did not disable the runtime THP policy or its larger purge granularity.MI_MALLOC_VERSION, preventing stale C objects after submodule updates.profile_disabled=true into new thread heaps without
clearing it. Dedicated-heap and worker-thread profiling can remain inactive.
Profiling stays experimental raw FFI; the integration test proves main-heap
sampling in an isolated single-threaded process only.crt-static target feature for MSVC builds instead of forcing
/MD, allowing a Windows binary and the vendored mimalloc library to use the
same static CRT (/MT) without a runtime DLL dependency.-C target-feature=+crt-static.d4881d3).30503.mi_free_csize_aligned{,_nonnull} FFI mirrors and MiMalloc methods.mi_theap_alloc_new, mi_theap_alloc_new_n, and
mi_theap_alloc_new_nothrow FFI. These retain their upstream C++ OOM-handler
semantics and intentionally have no safe Rust wrapper.636510a).30502.mi_wmalloc_small, mi_wzalloc_small, mi_wsize_from_size,
mi_malloc_csize, mi_zalloc_csize, mi_theap_wmalloc_small,
mi_theap_wzalloc_small, mi_theap_malloc_csize, and
mi_theap_zalloc_csize.MiMalloc wrappers for constant-size and word-size small
allocation fast paths.mi_option_collect_merges_stats and
mi_theap_stats_merge_to_heap through rustfs-mimalloc-sys.rustfs-mimalloc-sys
as raw FFI only.x86_64-pc-windows-gnullvm.CARGO_CFG_TARGET_* values to keep OS, ABI, architecture, and vendor checks
distinct.34fbd7e).30501.mi_free_small_nonnull binding.mi_free_csize and mi_free_csize_nonnull.MiMalloc wrappers for small and constant-size free fast paths.mi_thread_set_in_threadpool() through rustfs-mimalloc-sys and added a safe rustfs_mimalloc::set_current_thread_in_threadpool() wrapper.c_src/mimalloc/src/static.c.microsoft/mimalloc).cd69707).git fetch + git checkout in submodule directory.codeql-action to major version v4 in CI workflow.homepage and documentation fields to all Cargo.toml packages.README.md to rustfs-mimalloc-sys and rustfs-mimalloc sub-crates.readme field to sub-crate Cargo.toml files for crates.io display.win_direct_tls feature (unused in build.rs and source code).README.md to rustfs-mimalloc-sys and rustfs-mimalloc sub-crates.readme field to both sub-crate Cargo.toml files.extended feature and fine-grained secure_level_1..5 aliases.nightly_allocator_api feature so the crate remains fully verifiable on stable Rust.secure as the single heap-encryption feature and mapped it directly to mimalloc’s upstream default MI_SECURE=4.core::ffi platform C types.Heap::main() and Heap::heap_of() do not delete heaps they do not own.win_direct_tls feature (unused in build.rs and source code).extended feature; all stats/options/heap APIs are always available.nightly_allocator_api feature.secure_level_1..5 fine-grained features.rustfs-mimalloc-sys: low-level FFI crate that builds and links mimalloc V3 (v3.5.0).rustfs-mimalloc: safe global allocator wrapper implementing GlobalAlloc.MiMalloc::process_info(), MiMalloc::stats_json(), MiMalloc::stats_print(), MiMalloc::process_info_print(), MiMalloc::stats_reset().MiMalloc::option_set(), option_get(), option_enable(), option_disable().secure, debug, debug_in_debug, override, local_dynamic_tls, no_thp.