diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b5c8b723d..257493689 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,7 @@ name: CI on: pull_request: - branches: + branches: - 'master' - 'main' push: @@ -16,11 +16,11 @@ jobs: strategy: matrix: include: - - name: aarch64-unknown-linux-gnu - target: aarch64-unknown-linux-gnu + - name: x86_64-apple-darwin + target: x86_64-apple-darwin nobgt: 0 no_tests: 1 - tag: arm64 + tag: macos-13 - name: x86_64-unknown-linux-gnu (nightly) target: x86_64-unknown-linux-gnu nobgt: 0 @@ -38,11 +38,17 @@ jobs: nobgt: 1 no_tests: 1 tag: ubuntu-latest - - name: x86_64-apple-darwin (stable) - target: x86_64-apple-darwin + - name: aarch64-apple-darwin (stable) + target: aarch64-apple-darwin nobgt: 0 no_tests: 1 tag: macos-latest + - name: x86_64-unknown-linux-gnu (msrv) + target: x86_64-unknown-linux-gnu + nobgt: 0 + no_tests: 0 + rust: msrv + tag: ubuntu-latest runs-on: ${{ matrix.tag }} env: TARGET: ${{ matrix.target }} @@ -57,6 +63,9 @@ jobs: if [[ "${{ matrix.rust }}" == "nightly" ]]; then rustup default nightly fi + if [[ "${{ matrix.rust }}" == "msrv" ]]; then + rustup default `grep rust-version jemalloc-sys/Cargo.toml | cut -d '"' -f 2` + fi rustup target add ${{ matrix.target }} if [[ "$TARGET" == "x86_64-unknown-linux-musl" ]]; then sudo apt install -y musl-tools @@ -85,5 +94,5 @@ jobs: - run: cargo clippy -p jemallocator -- -D clippy::all - run: cargo clippy -p jemallocator-global -- -D clippy::all - run: cargo clippy -p jemalloc-ctl -- -D clippy::all - - run: env RUSTDOCFLAGS="--cfg jemallocator_docs" cargo doc + - run: env RUSTDOCFLAGS="--cfg jemallocator_docs" cargo doc --features stats,profiling,use_std - run: shellcheck ci/*.sh diff --git a/.gitmodules b/.gitmodules index 04dd40a57..ca215355e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "jemalloc-sys/jemalloc"] path = jemalloc-sys/jemalloc - url = https://github.com/jemalloc/jemalloc + url = https://github.com/tikv/jemalloc diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cbe5c3bb..e663d5200 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +# 0.6.0 - 2024-07-14 + +- Fix build on riscv64gc-unknown-linux-musl (#67) (#75) +- Allow jemalloc-sys to be the default allocator on musl linux (#70) +- Add Chimera Linux to gmake targets (#73) +- Add profiling options to jemalloc-ctl (#74) +- Fix jemalloc version not shown in API (#77) +- Fix jemalloc stats is still enabled when stats feature is disabled (#82) +- Fix duplicated symbol when build and link on aarch64-linux-android (#83) +- Revise CI runner platform on macOS (#86) +- Allow setting per-target env (#91) +- Remove outdated clippy allows (#94) +- Set MSRV to 1.71.0 (#95) + +Note since 0.6.0, if you want to use jemalloc stats, you have to enable the +feature explicitly. + # 0.5.4 - 2023-07-22 - Add disable_initial_exec_tls feature for jemalloc-ctl (#59) diff --git a/jemalloc-ctl/Cargo.toml b/jemalloc-ctl/Cargo.toml index 5f87cb76d..81b7da687 100644 --- a/jemalloc-ctl/Cargo.toml +++ b/jemalloc-ctl/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jemalloc-ctl" -version = "0.5.4" +version = "0.6.0" authors = [ "Steven Fackler ", "Gonzalo Brito Gadeschi ", @@ -26,17 +26,20 @@ is-it-maintained-open-issues = { repository = "tikv/jemallocator" } maintenance = { status = "actively-developed" } [dependencies] -jemalloc-sys = { path = "../jemalloc-sys", version = "0.5.0" } +jemalloc-sys = { path = "../jemalloc-sys", version = "0.6.0" } libc = { version = "0.2", default-features = false } paste = "1" [dev-dependencies] -jemallocator = { path = "../jemallocator", version = "0.5.0" } +jemallocator = { path = "../jemallocator", version = "0.6.0" } [features] default = [] +stats = ["jemalloc-sys/stats"] +profiling = ["jemalloc-sys/profiling"] use_std = [ "libc/use_std" ] disable_initial_exec_tls = ["jemalloc-sys/disable_initial_exec_tls"] [package.metadata.docs.rs] rustdoc-args = [ "--cfg", "jemallocator_docs" ] +features = ["stats", "profiling", "use_std"] diff --git a/jemalloc-ctl/src/error.rs b/jemalloc-ctl/src/error.rs index 1725a45d3..e84d29a12 100644 --- a/jemalloc-ctl/src/error.rs +++ b/jemalloc-ctl/src/error.rs @@ -1,8 +1,4 @@ //! Error type -#![cfg_attr( - feature = "cargo-clippy", - allow(clippy::cast_sign_loss, clippy::cast_possible_wrap) -)] use crate::{fmt, num, result}; use libc::c_int; diff --git a/jemalloc-ctl/src/lib.rs b/jemalloc-ctl/src/lib.rs index 708ea1a7f..6ca3a0d2a 100644 --- a/jemalloc-ctl/src/lib.rs +++ b/jemalloc-ctl/src/lib.rs @@ -13,62 +13,66 @@ //! `$op::{read(), write(x), update(x)}` on the type calls `mallctl` with the //! string-based API. If the operation will be repeatedly performed, a MIB for //! the operation can be obtained using `$op.mib()`. -//! -//! # Examples -//! -//! Repeatedly printing allocation statistics: -//! -//! ```no_run -//! use std::thread; -//! use std::time::Duration; -//! use jemalloc_ctl::{stats, epoch}; -//! -//! #[global_allocator] -//! static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; -//! -//! fn main() { -//! loop { -//! // many statistics are cached and only updated when the epoch is advanced. -//! epoch::advance().unwrap(); -//! -//! let allocated = stats::allocated::read().unwrap(); -//! let resident = stats::resident::read().unwrap(); -//! println!("{} bytes allocated/{} bytes resident", allocated, resident); -//! thread::sleep(Duration::from_secs(10)); -//! } -//! } -//! ``` -//! -//! Doing the same with the MIB-based API: -//! -//! ```no_run -//! use std::thread; -//! use std::time::Duration; -//! use jemalloc_ctl::{stats, epoch}; -//! -//! #[global_allocator] -//! static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; -//! -//! fn main() { -//! let e = epoch::mib().unwrap(); -//! let allocated = stats::allocated::mib().unwrap(); -//! let resident = stats::resident::mib().unwrap(); -//! loop { -//! // many statistics are cached and only updated when the epoch is advanced. -//! e.advance().unwrap(); -//! -//! let allocated = allocated.read().unwrap(); -//! let resident = resident.read().unwrap(); -//! println!("{} bytes allocated/{} bytes resident", allocated, resident); -//! thread::sleep(Duration::from_secs(10)); -//! } -//! } -//! ``` +#![cfg_attr( + feature = "stats", + doc = r##" + +# Examples + +Repeatedly printing allocation statistics: + +```no_run +use std::thread; +use std::time::Duration; +use jemalloc_ctl::{stats, epoch}; + +#[global_allocator] +static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; + +fn main() { + loop { + // many statistics are cached and only updated when the epoch is advanced. + epoch::advance().unwrap(); + + let allocated = stats::allocated::read().unwrap(); + let resident = stats::resident::read().unwrap(); + println!("{} bytes allocated/{} bytes resident", allocated, resident); + thread::sleep(Duration::from_secs(10)); + } +} +``` + +Doing the same with the MIB-based API: + +```no_run +use std::thread; +use std::time::Duration; +use jemalloc_ctl::{stats, epoch}; + +#[global_allocator] +static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; + +fn main() { + let e = epoch::mib().unwrap(); + let allocated = stats::allocated::mib().unwrap(); + let resident = stats::resident::mib().unwrap(); + loop { + // many statistics are cached and only updated when the epoch is advanced. + e.advance().unwrap(); + + let allocated = allocated.read().unwrap(); + let resident = resident.read().unwrap(); + println!("{} bytes allocated/{} bytes resident", allocated, resident); + thread::sleep(Duration::from_secs(10)); + } +} +``` +"## +)] // TODO: rename the following lint on next minor bump #![allow(renamed_and_removed_lints)] #![deny(missing_docs, broken_intra_doc_links)] #![cfg_attr(not(feature = "use_std"), no_std)] -#![cfg_attr(feature = "cargo-clippy", allow(clippy::module_name_repetitions))] #[cfg(test)] #[global_allocator] @@ -88,7 +92,10 @@ pub mod config; mod error; mod keys; pub mod opt; +#[cfg(feature = "profiling")] +pub mod profiling; pub mod raw; +#[cfg(feature = "stats")] pub mod stats; #[cfg(feature = "use_std")] pub mod stats_print; diff --git a/jemalloc-ctl/src/profiling.rs b/jemalloc-ctl/src/profiling.rs new file mode 100644 index 000000000..189ba66da --- /dev/null +++ b/jemalloc-ctl/src/profiling.rs @@ -0,0 +1,155 @@ +//! `jemalloc`'s run-time configuration for profiling-specific settings. +//! +//! These settings are controlled by the `MALLOC_CONF` environment variable. + +option! { + lg_prof_interval[ str: b"opt.lg_prof_interval\0", non_str: 2 ] => libc::ssize_t | + ops: r | + docs: + /// Average interval (log base 2) between memory profile dumps, as measured in bytes of + /// allocation activity. + /// + /// The actual interval between dumps may be sporadic because + /// decentralized allocation counters are used to avoid synchronization bottlenecks. + /// + /// Profiles are dumped to files named according to the pattern + /// \.\.\.i\.heap, where \ is controlled by the + /// opt.prof_prefix and prof.prefix options. By default, interval-triggered profile dumping is + /// disabled (encoded as -1). + /// + /// # Examples + /// + /// ``` + /// # #[global_allocator] + /// # static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; + /// # + /// # fn main() { + /// use jemalloc_ctl::profiling; + /// let lg_prof_interval = profiling::lg_prof_interval::read().unwrap(); + /// println!("average interval between memory profile dumps: {}", lg_prof_interval); + /// # } + /// ``` + mib_docs: /// See [`lg_prof_interval`]. +} + +option! { + lg_prof_sample[ str: b"opt.lg_prof_sample\0", non_str: 2 ] => libc::size_t | + ops: r | + docs: + /// Average interval (log base 2) between allocation samples, as measured in bytes of + /// allocation activity. Increasing the sampling interval decreases profile fidelity, but also + /// decreases the computational overhead. + /// + /// The default sample interval is 512 KiB (2^19 B). + /// + /// # Examples + /// + /// ``` + /// # #[global_allocator] + /// # static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; + /// # + /// # fn main() { + /// use jemalloc_ctl::profiling; + /// let lg_prof_sample = profiling::lg_prof_sample::read().unwrap(); + /// println!("average interval between allocation samples: {}", lg_prof_sample); + /// # } + /// ``` + mib_docs: /// See [`lg_prof_sample`]. +} + +option! { + prof_final[ str: b"opt.prof_final\0", non_str: 2 ] => bool | + ops: r | + docs: + /// Use an atexit(3) function to dump final memory usage to a file named according to the + /// pattern \.\.\.f.heap, where \ is controlled by the opt.prof_prefix + /// and prof.prefix options. + /// + /// Note that atexit() may allocate memory during application initialization and then deadlock + /// internally when jemalloc in turn calls `atexit()`, so this option is not universally usable + /// (though the application can register its own `atexit()` function with equivalent + /// functionality). + /// + /// This option is disabled by default. + /// + /// # Examples + /// + /// ``` + /// # #[global_allocator] + /// # static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; + /// # + /// # fn main() { + /// use jemalloc_ctl::profiling; + /// let prof_final = profiling::prof_final::read().unwrap(); + /// println!("dump final memory usage to file: {}", prof_final); + /// # } + /// ``` + mib_docs: /// See [`prof_final`]. +} + +option! { + prof[ str: b"opt.prof\0", non_str: 2 ] => bool | + ops: r | + docs: + /// Memory profiling enabled/disabled. + /// + /// If enabled, profile memory allocation activity. + /// + /// See the `opt.prof_active` option for on-the-fly activation/deactivation. + /// + /// See the `opt.lg_prof_sample` option for probabilistic sampling control. + /// + /// See the `opt.prof_accum` option for control of cumulative sample reporting. + /// + /// See the `opt.lg_prof_interval` option for information on interval-triggered profile + /// dumping, the `opt.prof_gdump` option for information on high-water-triggered profile + /// dumping, and the `opt.prof_final` option for final profile dumping. + /// + /// Profile output is compatible with the jeprof command, which is based on the pprof that is + /// developed as part of the gperftools package. See `HEAP PROFILE FORMAT` for heap profile + /// format documentation. + /// + /// # Examples + /// + /// ``` + /// # #[global_allocator] + /// # static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; + /// # + /// # fn main() { + /// use jemalloc_ctl::profiling; + /// let prof = profiling::prof::read().unwrap(); + /// println!("is memory profiling enabled: {}", prof); + /// # } + /// ``` + mib_docs: /// See [`prof`]. +} + +option! { + prof_leak[ str: b"opt.prof_leak\0", non_str: 2 ] => bool | + ops: r | + docs: + /// Leak reporting enabled/disabled. + /// + /// If enabled, use an `atexit(3)` function to report memory leaks detected by allocation + /// sampling. + /// + /// See the opt.prof option for information on analyzing heap profile output. + /// + /// Works only when combined with `opt.prof_final`, otherwise does nothing. + /// + /// This option is disabled by default. + /// + /// # Examples + /// + /// ``` + /// # #[global_allocator] + /// # static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; + /// # + /// # fn main() { + /// use jemalloc_ctl::profiling; + /// let prof_leak = profiling::prof_leak::read().unwrap(); + /// println!("is leak reporting enabled: {}", prof_leak); + /// # } + /// ``` + mib_docs: /// See [`prof_leak`]. +} diff --git a/jemalloc-sys/Cargo.toml b/jemalloc-sys/Cargo.toml index 2f48f8498..ccd0bbcc0 100644 --- a/jemalloc-sys/Cargo.toml +++ b/jemalloc-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jemalloc-sys" -version = "0.5.4+5.3.0-patched" +version = "0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7" authors = [ "Alex Crichton ", "Gonzalo Brito Gadeschi ", @@ -18,6 +18,7 @@ description = """ Rust FFI bindings to jemalloc """ edition = "2018" +rust-version = "1.71.0" [badges] codecov = { repository = "tikv/jemallocator" } diff --git a/jemalloc-sys/build.rs b/jemalloc-sys/build.rs index cf1ff4533..b91d3e3d6 100644 --- a/jemalloc-sys/build.rs +++ b/jemalloc-sys/build.rs @@ -28,14 +28,28 @@ macro_rules! warning { } } +fn read_and_watch_env_impl(name: &str, env_getter: F) -> Option +where + F: Fn(&str) -> Option, +{ + let prefix = env::var("TARGET").unwrap().to_uppercase().replace('-', "_"); + let prefixed_name = format!("{}_{}", prefix, name); + + println!("cargo:rerun-if-env-changed={}", prefixed_name); + if let Some(value) = env_getter(&prefixed_name) { + return Some(value); + } + + println!("cargo:rerun-if-env-changed={}", name); + env_getter(name) +} + fn read_and_watch_env(name: &str) -> Result { - println!("cargo:rerun-if-env-changed={name}"); - env::var(name) + read_and_watch_env_impl(name, |n| env::var(n).ok()).ok_or(env::VarError::NotPresent) } fn read_and_watch_env_os(name: &str) -> Option { - println!("cargo:rerun-if-env-changed={name}"); - env::var_os(name) + read_and_watch_env_impl(name, |n| env::var_os(n)) } fn copy_recursively(src: &Path, dst: &Path) -> io::Result<()> { @@ -55,14 +69,23 @@ fn copy_recursively(src: &Path, dst: &Path) -> io::Result<()> { Ok(()) } +fn expect_env(name: &str) -> String { + env::var(name).unwrap_or_else(|_| panic!("{} was not set", name)) +} + // TODO: split main functions and remove following allow. #[allow(clippy::cognitive_complexity)] fn main() { - let target = env::var("TARGET").expect("TARGET was not set"); - let host = env::var("HOST").expect("HOST was not set"); - let num_jobs = env::var("NUM_JOBS").expect("NUM_JOBS was not set"); + let target = expect_env("TARGET"); + let host = expect_env("HOST"); + let num_jobs = expect_env("NUM_JOBS"); let out_dir = PathBuf::from(env::var_os("OUT_DIR").expect("OUT_DIR was not set")); let src_dir = env::current_dir().expect("failed to get current directory"); + let version = expect_env("CARGO_PKG_VERSION"); + let je_version = version + .split_once('+') + .expect("jemalloc version is missing") + .1; info!("TARGET={}", target); info!("HOST={}", host); @@ -147,7 +170,7 @@ fn main() { assert!(build_dir.exists()); // Configuration files - let config_files = ["configure", "VERSION"]; + let config_files = ["configure"]; // Copy the configuration files to jemalloc's source directory for f in &config_files { @@ -170,6 +193,7 @@ fn main() { .env("CFLAGS", cflags.clone()) .env("LDFLAGS", cflags.clone()) .env("CPPFLAGS", cflags) + .arg(format!("--with-version={je_version}")) .arg("--disable-cxx") .arg("--enable-doc=no") .arg("--enable-shared=no"); @@ -255,6 +279,9 @@ fn main() { if env::var("CARGO_FEATURE_STATS").is_ok() { info!("CARGO_FEATURE_STATS set"); cmd.arg("--enable-stats"); + } else { + info!("CARGO_FEATURE_STATS not set"); + cmd.arg("--disable-stats"); } if env::var("CARGO_FEATURE_DISABLE_INITIAL_EXEC_TLS").is_ok() { @@ -328,6 +355,16 @@ fn main() { println!("cargo:rustc-link-lib=atomic"); } println!("cargo:rerun-if-changed=jemalloc"); + + if target.contains("android") { + // These symbols are used by jemalloc on android but the really old android + // we're building on doesn't have them defined, so just make sure the symbols + // are available. + cc::Build::new() + .file("src/pthread_atfork.c") + .compile("pthread_atfork"); + println!("cargo:rerun-if-changed=src/pthread_atfork.c"); + } } fn run_and_log(cmd: &mut Command, log_file: &Path) { @@ -364,12 +401,20 @@ fn gnu_target(target: &str) -> String { "x86_64-pc-windows-gnu" => "x86_64-w64-mingw32".to_string(), "armv7-linux-androideabi" => "arm-linux-androideabi".to_string(), "riscv64gc-unknown-linux-gnu" => "riscv64-linux-gnu".to_string(), + "riscv64gc-unknown-linux-musl" => "riscv64-linux-musl".to_string(), s => s.to_string(), } } fn make_cmd(host: &str) -> &'static str { - const GMAKE_HOSTS: &[&str] = &["bitrig", "dragonfly", "freebsd", "netbsd", "openbsd"]; + const GMAKE_HOSTS: &[&str] = &[ + "bitrig", + "dragonfly", + "freebsd", + "netbsd", + "openbsd", + "chimera-linux", + ]; if GMAKE_HOSTS.iter().any(|i| host.contains(i)) { "gmake" } else if host.contains("windows") { diff --git a/jemalloc-sys/configure/VERSION b/jemalloc-sys/configure/VERSION deleted file mode 100644 index 1dcfea03f..000000000 --- a/jemalloc-sys/configure/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.3.0-0-g54eaed1d8b56b1aa528be3bdd1877e59c56fa90c diff --git a/jemalloc-sys/src/env.rs b/jemalloc-sys/src/env.rs index f4d3e8e1d..2053ad306 100644 --- a/jemalloc-sys/src/env.rs +++ b/jemalloc-sys/src/env.rs @@ -19,7 +19,6 @@ pub static NO_BG_THREAD_TARGETS: &[&str] = &["musl"]; // (not jemalloc malloc), and then the standard library would free with jemalloc free, // causing a segfault.” // https://github.com/rust-lang/rust/commit/e3b414d8612314e74e2b0ebde1ed5c6997d28e8d -// https://github.com/rust-lang/rust/commit/536011d929ecbd1170baf34e09580e567c971f95 // https://github.com/rust-lang/rust/commit/9f3de647326fbe50e0e283b9018ab7c41abccde3 // https://github.com/rust-lang/rust/commit/ed015456a114ae907a36af80c06f81ea93182a24 -pub static NO_UNPREFIXED_MALLOC_TARGETS: &[&str] = &["android", "dragonfly", "musl", "darwin"]; +pub static NO_UNPREFIXED_MALLOC_TARGETS: &[&str] = &["android", "dragonfly", "darwin"]; diff --git a/jemalloc-sys/src/lib.rs b/jemalloc-sys/src/lib.rs index 58010afdc..79096a0f8 100644 --- a/jemalloc-sys/src/lib.rs +++ b/jemalloc-sys/src/lib.rs @@ -41,10 +41,6 @@ //! [jemalloc_mallctl]: http://jemalloc.net/jemalloc.3.html#mallctl_namespace #![no_std] #![allow(non_snake_case, non_camel_case_types)] -#![cfg_attr( - feature = "cargo-clippy", - allow(clippy::cast_possible_truncation, clippy::cast_possible_wrap) -)] // TODO: rename the following lint on next minor bump #![allow(renamed_and_removed_lints)] #![deny(missing_docs, broken_intra_doc_links)] @@ -890,20 +886,6 @@ pub type extent_merge_t = unsafe extern "C" fn( arena_ind: c_uint, ) -> c_bool; -// These symbols are used by jemalloc on android but the really old android -// we're building on doesn't have them defined, so just make sure the symbols -// are available. -#[no_mangle] -#[cfg(target_os = "android")] -#[doc(hidden)] -pub extern "C" fn pthread_atfork( - _prefork: *mut u8, - _postfork_parent: *mut u8, - _postfork_child: *mut u8, -) -> i32 { - 0 -} - #[allow(missing_docs)] mod env; diff --git a/jemalloc-sys/src/pthread_atfork.c b/jemalloc-sys/src/pthread_atfork.c new file mode 100644 index 000000000..254443d20 --- /dev/null +++ b/jemalloc-sys/src/pthread_atfork.c @@ -0,0 +1,11 @@ +/* + * These symbols are used by jemalloc on android but the really old android + * we're building on doesn't have them defined, so just make sure the symbols + * are available. + */ +__attribute__((weak)) int +pthread_atfork(void (*prepare)(void) __attribute__((unused)), + void (*parent)(void) __attribute__((unused)), + void (*child)(void) __attribute__((unused))) { + return 0; +} diff --git a/jemallocator-global/Cargo.toml b/jemallocator-global/Cargo.toml index 34f878bd2..0da0a21c7 100644 --- a/jemallocator-global/Cargo.toml +++ b/jemallocator-global/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "jemallocator-global" # Make sure to update the version in the readme as well: -version = "0.5.0" +version = "0.6.0" authors = [ "Gonzalo Brito Gadeschi ", "The TiKV Project Developers", @@ -26,7 +26,7 @@ is-it-maintained-open-issues = { repository = "tikv/jemallocator" } maintenance = { status = "actively-developed" } [dependencies] -jemallocator = { version = "0.5.0", path = "../jemallocator", optional = true } +jemallocator = { version = "0.6.0", path = "../jemallocator", optional = true } cfg-if = "0.1" [features] @@ -38,7 +38,7 @@ force_global_jemalloc = [ "jemallocator" ] # for a particular target, white-list the target explicitly here: [target.'cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd"))'.dependencies] -jemallocator = { version = "0.5.0", path = "../jemallocator", optional = false } +jemallocator = { version = "0.6.0", path = "../jemallocator", optional = false } # FIXME: https://github.com/gnzlbg/jemallocator/issues/91 # [target.'cfg(target_os = "windows")'.dependencies] diff --git a/jemallocator-global/README.md b/jemallocator-global/README.md index 0bed0b204..5c320f1b9 100644 --- a/jemallocator-global/README.md +++ b/jemallocator-global/README.md @@ -11,7 +11,7 @@ Add it as a dependency: ```toml # Cargo.toml [dependencies] -jemallocator-global = "0.5.0" +jemallocator-global = "0.6.0" ``` and `jemalloc` will be used as the `#[global_allocator]` on targets that support diff --git a/jemallocator-global/src/lib.rs b/jemallocator-global/src/lib.rs index 36207ff3c..923c31d26 100644 --- a/jemallocator-global/src/lib.rs +++ b/jemallocator-global/src/lib.rs @@ -5,7 +5,7 @@ //! ```toml //! # Cargo.toml //! [dependencies] -//! jemallocator-global = "0.5.0" +//! jemallocator-global = "0.6.0" //! ``` //! //! and `jemalloc` will be used as the `#[global_allocator]` on targets that diff --git a/jemallocator/Cargo.toml b/jemallocator/Cargo.toml index 355c3d137..53d9a31e2 100644 --- a/jemallocator/Cargo.toml +++ b/jemallocator/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "jemallocator" # Make sure to update the version in the README as well: -version = "0.5.4" +version = "0.6.0" authors = [ "Alex Crichton ", "Gonzalo Brito Gadeschi ", @@ -32,13 +32,17 @@ maintenance = { status = "actively-developed" } test = false bench = false +[[test]] +name = "ffi" +required-features = ["stats"] + [dependencies] -jemalloc-sys = { path = "../jemalloc-sys", version = "0.5.0", default-features = false } +jemalloc-sys = { path = "../jemalloc-sys", version = "0.6.0", default-features = false } libc = { version = "^0.2.8", default-features = false } [dev-dependencies] paste = "1" -jemalloc-ctl = { path = "../jemalloc-ctl", version = "0.5.0" } +jemalloc-ctl = { path = "../jemalloc-ctl", version = "0.6.0" } [features] default = ["background_threads_runtime_support"] diff --git a/jemallocator/README.md b/jemallocator/README.md index e9e13e66d..43e00d106 100644 --- a/jemallocator/README.md +++ b/jemallocator/README.md @@ -30,13 +30,13 @@ To use `tikv-jemallocator` add it as a dependency: [dependencies] [target.'cfg(not(target_env = "msvc"))'.dependencies] -tikv-jemallocator = "0.5" +tikv-jemallocator = "0.6" ``` To set `tikv_jemallocator::Jemalloc` as the global allocator add this to your project: ```rust -# main.rs +// main.rs #[cfg(not(target_env = "msvc"))] use tikv_jemallocator::Jemalloc; @@ -65,7 +65,7 @@ other targets are only tested on Rust nightly. | `powerpc64le-unknown-linux-gnu` | ✓ | ✓ | ✗ | | `x86_64-unknown-linux-gnu` (tier 1) | ✓ | ✓ | ✓ | | **MacOSX targets:** | **build** | **run** | **jemalloc** | -| `x86_64-apple-darwin` (tier 1) | ✓ | ✓ | ✗ | +| `aarch64-apple-darwin` | ✓ | ✓ | ✗ | ## Features