Add jemalloc and jemalloc-auto features

Introduce the new features jemalloc (set jemalloc global allocator
unconditionally) and jemalloc-auto (set jemalloc global allocator on
musl-based targets to fix multithreaded performance, see [1]).

Because cargo does not support target-specific features or feature
defaults, the default is handled using a helper crate
minedmap-default-alloc.

[1] https://nickb.dev/blog/default-musl-allocator-considered-harmful-to-performance/
This commit is contained in:
Matthias Schiffer 2025-02-12 20:22:26 +01:00
parent a25b3cdbd7
commit 1d9be9a41c
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
6 changed files with 77 additions and 1 deletions

View file

@ -2,6 +2,9 @@
#![warn(missing_docs)]
#![warn(clippy::missing_docs_in_private_items)]
#[cfg(feature = "jemalloc-auto")]
extern crate minedmap_default_alloc;
mod core;
mod io;
mod util;