Skip to content

Commit

Permalink
jemalloc-sys: bump 0.5.3 (#48)
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
  • Loading branch information
BusyJay authored Feb 6, 2023
1 parent 725713e commit 444e0ef
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 20 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# jemalloc-sys 0.5.3 - 2023-02-03

- Remove fs-extra dependency (#47)

# jemalloc-sys 0.5.2 - 2022-09-29

- Fix build on riscv64gc-unknown-linux-gnu (#40)
Expand Down
4 changes: 2 additions & 2 deletions jemalloc-ctl/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ impl fmt::Debug for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let code = self.0.get() as c_int;
match description(code) {
Some(m) => write!(f, "{}", m),
None => write!(f, "Unknown error code: \"{}\".", code),
Some(m) => write!(f, "{m}"),
None => write!(f, "Unknown error code: \"{code}\"."),
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions jemalloc-ctl/src/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
//! }
//! ```

#![allow(clippy::uninlined_format_args)]

use crate::error::Result;
use crate::std::str;
use crate::{fmt, ops, raw};
Expand Down
2 changes: 1 addition & 1 deletion 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.2+5.3.0-patched"
version = "0.5.3+5.3.0-patched"
authors = [
"Alex Crichton <alex@alexcrichton.com>",
"Gonzalo Brito Gadeschi <gonzalobg88@gmail.com>",
Expand Down
16 changes: 8 additions & 8 deletions jemalloc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ macro_rules! warning {
}

fn read_and_watch_env(name: &str) -> Result<String, env::VarError> {
println!("cargo:rerun-if-env-changed={}", name);
println!("cargo:rerun-if-env-changed={name}");
env::var(name)
}

fn read_and_watch_env_os(name: &str) -> Option<OsString> {
println!("cargo:rerun-if-env-changed={}", name);
println!("cargo:rerun-if-env-changed={name}");
env::var_os(name)
}

Expand Down Expand Up @@ -212,27 +212,27 @@ fn main() {

if !malloc_conf.is_empty() {
info!("--with-malloc-conf={}", malloc_conf);
cmd.arg(format!("--with-malloc-conf={}", malloc_conf));
cmd.arg(format!("--with-malloc-conf={malloc_conf}"));
}

if let Ok(lg_page) = read_and_watch_env("JEMALLOC_SYS_WITH_LG_PAGE") {
info!("--with-lg-page={}", lg_page);
cmd.arg(format!("--with-lg-page={}", lg_page));
cmd.arg(format!("--with-lg-page={lg_page}"));
}

if let Ok(lg_hugepage) = read_and_watch_env("JEMALLOC_SYS_WITH_LG_HUGEPAGE") {
info!("--with-lg-hugepage={}", lg_hugepage);
cmd.arg(format!("--with-lg-hugepage={}", lg_hugepage));
cmd.arg(format!("--with-lg-hugepage={lg_hugepage}"));
}

if let Ok(lg_quantum) = read_and_watch_env("JEMALLOC_SYS_WITH_LG_QUANTUM") {
info!("--with-lg-quantum={}", lg_quantum);
cmd.arg(format!("--with-lg-quantum={}", lg_quantum));
cmd.arg(format!("--with-lg-quantum={lg_quantum}"));
}

if let Ok(lg_vaddr) = read_and_watch_env("JEMALLOC_SYS_WITH_LG_VADDR") {
info!("--with-lg-vaddr={}", lg_vaddr);
cmd.arg(format!("--with-lg-vaddr={}", lg_vaddr));
cmd.arg(format!("--with-lg-vaddr={lg_vaddr}"));
}

if use_prefix {
Expand Down Expand Up @@ -336,7 +336,7 @@ fn run(cmd: &mut Command) {
}

fn execute(cmd: &mut Command, on_fail: impl FnOnce()) {
println!("running: {:?}", cmd);
println!("running: {cmd:?}");
let status = match cmd.status() {
Ok(status) => status,
Err(e) => panic!("failed to execute command: {}", e),
Expand Down
10 changes: 2 additions & 8 deletions jemallocator/tests/background_thread_defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,9 @@ fn background_threads_runtime_defaults() {
if !cfg!(feature = "background_threads_runtime_support") {
// If the crate was compiled without background thread support,
// then background threads are always disabled at run-time by default:
assert_eq!(background_threads(), false);
assert!(!background_threads());
return;
}

if cfg!(feature = "background_threads") {
// The crate was compiled with background-threads enabled by default:
assert_eq!(background_threads(), true);
} else {
// The crate was compiled with background-threads disabled by default:
assert_eq!(background_threads(), false);
}
assert_eq!(background_threads(), cfg!(feature = "background_threads"));
}
2 changes: 1 addition & 1 deletion jemallocator/tests/malloctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ static A: Jemalloc = Jemalloc;
fn smoke() {
let layout = Layout::from_size_align(100, 8).unwrap();
unsafe {
let ptr = Jemalloc.alloc(layout.clone());
let ptr = Jemalloc.alloc(layout);
assert!(!ptr.is_null());
Jemalloc.dealloc(ptr, layout);
}
Expand Down
1 change: 1 addition & 0 deletions jemallocator/tests/smoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ static A: Jemalloc = Jemalloc;
#[test]
fn smoke() {
let mut a = Vec::new();
a.reserve(1);
a.push(3);
}

Expand Down

0 comments on commit 444e0ef

Please sign in to comment.