Skip to content

Commit

Permalink
*: bump 0.6.0 (#95)
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Lee <BusyJay@users.noreply.github.com>
  • Loading branch information
BusyJay authored Jul 14, 2024
1 parent 2fde3d8 commit f260a80
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 72 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ jobs:
strategy:
matrix:
include:
- name: aarch64-unknown-linux-gnu
target: aarch64-unknown-linux-gnu
nobgt: 0
no_tests: 1
tag: arm64
- name: x86_64-apple-darwin
target: x86_64-apple-darwin
nobgt: 0
Expand Down Expand Up @@ -48,6 +43,12 @@ jobs:
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 }}
Expand All @@ -62,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
Expand Down Expand Up @@ -90,5 +94,5 @@ jobs:
- run: cargo clippy -p tikv-jemallocator -- -D clippy::all
- run: cargo clippy -p tikv-jemallocator-global -- -D clippy::all
- run: cargo clippy -p tikv-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
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
8 changes: 5 additions & 3 deletions jemalloc-ctl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tikv-jemalloc-ctl"
version = "0.5.4"
version = "0.6.0"
authors = [
"Steven Fackler <sfackler@gmail.com>",
"Gonzalo Brito Gadeschi <gonzalobg88@gmail.com>",
Expand All @@ -26,18 +26,20 @@ is-it-maintained-open-issues = { repository = "tikv/jemallocator" }
maintenance = { status = "actively-developed" }

[dependencies]
tikv-jemalloc-sys = { path = "../jemalloc-sys", version = "0.5.0" }
tikv-jemalloc-sys = { path = "../jemalloc-sys", version = "0.6.0" }
libc = { version = "0.2", default-features = false }
paste = "1"

[dev-dependencies]
tikv-jemallocator = { path = "../jemallocator", version = "0.5.0" }
tikv-jemallocator = { path = "../jemallocator", version = "0.6.0" }

[features]
default = []
stats = ["tikv-jemalloc-sys/stats"]
profiling = ["tikv-jemalloc-sys/profiling"]
use_std = [ "libc/use_std" ]
disable_initial_exec_tls = ["tikv-jemalloc-sys/disable_initial_exec_tls"]

[package.metadata.docs.rs]
rustdoc-args = [ "--cfg", "jemallocator_docs" ]
features = ["stats", "profiling", "use_std"]
108 changes: 57 additions & 51 deletions jemalloc-ctl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,57 +13,62 @@
//! `$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 tikv_jemalloc_ctl::{stats, epoch};
//!
//! #[global_allocator]
//! static ALLOC: tikv_jemallocator::Jemalloc = tikv_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 tikv_jemalloc_ctl::{stats, epoch};
//!
//! #[global_allocator]
//! static ALLOC: tikv_jemallocator::Jemalloc = tikv_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 tikv_jemalloc_ctl::{stats, epoch};
#[global_allocator]
static ALLOC: tikv_jemallocator::Jemalloc = tikv_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 tikv_jemalloc_ctl::{stats, epoch};
#[global_allocator]
static ALLOC: tikv_jemallocator::Jemalloc = tikv_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)]
Expand All @@ -90,6 +95,7 @@ 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;
Expand Down
5 changes: 3 additions & 2 deletions jemalloc-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tikv-jemalloc-sys"
version = "0.5.4+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7"
version = "0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7"
authors = [
"Alex Crichton <alex@alexcrichton.com>",
"Gonzalo Brito Gadeschi <gonzalobg88@gmail.com>",
Expand All @@ -18,6 +18,7 @@ description = """
Rust FFI bindings to jemalloc
"""
edition = "2018"
rust-version = "1.71.0"

[badges]
codecov = { repository = "tikv/jemallocator" }
Expand All @@ -32,7 +33,7 @@ libc = { version = "^0.2.8", default-features = false }
cc = "^1.0.13"

[features]
default = ["stats", "background_threads_runtime_support"]
default = ["background_threads_runtime_support"]
profiling = []
debug = []
background_threads_runtime_support = []
Expand Down
6 changes: 3 additions & 3 deletions jemallocator-global/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tikv-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 <gonzalobg88@gmail.com>",
"The TiKV Project Developers",
Expand All @@ -26,7 +26,7 @@ is-it-maintained-open-issues = { repository = "tikv/jemallocator" }
maintenance = { status = "actively-developed" }

[dependencies]
tikv-jemallocator = { version = "0.5.0", path = "../jemallocator", optional = true }
tikv-jemallocator = { version = "0.6.0", path = "../jemallocator", optional = true }
cfg-if = "0.1"

[features]
Expand All @@ -38,7 +38,7 @@ force_global_jemalloc = [ "tikv-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]
tikv-jemallocator = { version = "0.5.0", path = "../jemallocator", optional = false }
tikv-jemallocator = { version = "0.6.0", path = "../jemallocator", optional = false }

# FIXME: https://github.com/gnzlbg/jemallocator/issues/91
# [target.'cfg(target_os = "windows")'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion jemallocator-global/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Add it as a dependency:
```toml
# Cargo.toml
[dependencies]
tikv-jemallocator-global = "0.5.0"
tikv-jemallocator-global = "0.6.0"
```

and `jemalloc` will be used as the `#[global_allocator]` on targets that support
Expand Down
2 changes: 1 addition & 1 deletion jemallocator-global/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions jemallocator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tikv-jemallocator"
# Make sure to update the version in the README as well:
version = "0.5.4"
version = "0.6.0"
authors = [
"Alex Crichton <alex@alexcrichton.com>",
"Gonzalo Brito Gadeschi <gonzalobg88@gmail.com>",
Expand Down Expand Up @@ -32,16 +32,20 @@ maintenance = { status = "actively-developed" }
test = false
bench = false

[[test]]
name = "ffi"
required-features = ["stats"]

[dependencies]
tikv-jemalloc-sys = { path = "../jemalloc-sys", version = "0.5.0", default-features = false }
tikv-jemalloc-sys = { path = "../jemalloc-sys", version = "0.6.0", default-features = false }
libc = { version = "^0.2.8", default-features = false }

[dev-dependencies]
paste = "1"
tikv-jemalloc-ctl = { path = "../jemalloc-ctl", version = "0.5.0" }
tikv-jemalloc-ctl = { path = "../jemalloc-ctl", version = "0.6.0" }

[features]
default = ["stats", "background_threads_runtime_support"]
default = ["background_threads_runtime_support"]
alloc_trait = []
profiling = ["tikv-jemalloc-sys/profiling"]
debug = ["tikv-jemalloc-sys/debug"]
Expand Down
2 changes: 1 addition & 1 deletion jemallocator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ 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:
Expand Down

0 comments on commit f260a80

Please sign in to comment.