jemalloc-sys: bump 0.5.3 (#48)

Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
This commit is contained in:
Jay 2023-02-06 15:30:20 +08:00 committed by GitHub
parent 725713e565
commit 444e0efb81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 21 additions and 20 deletions

View File

@ -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 # jemalloc-sys 0.5.2 - 2022-09-29
- Fix build on riscv64gc-unknown-linux-gnu (#40) - Fix build on riscv64gc-unknown-linux-gnu (#40)

View File

@ -34,8 +34,8 @@ impl fmt::Debug for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let code = self.0.get() as c_int; let code = self.0.get() as c_int;
match description(code) { match description(code) {
Some(m) => write!(f, "{}", m), Some(m) => write!(f, "{m}"),
None => write!(f, "Unknown error code: \"{}\".", code), None => write!(f, "Unknown error code: \"{code}\"."),
} }
} }
} }

View File

@ -25,6 +25,8 @@
//! } //! }
//! ``` //! ```
#![allow(clippy::uninlined_format_args)]
use crate::error::Result; use crate::error::Result;
use crate::std::str; use crate::std::str;
use crate::{fmt, ops, raw}; use crate::{fmt, ops, raw};

View File

@ -1,6 +1,6 @@
[package] [package]
name = "tikv-jemalloc-sys" name = "tikv-jemalloc-sys"
version = "0.5.2+5.3.0-patched" version = "0.5.3+5.3.0-patched"
authors = [ authors = [
"Alex Crichton <alex@alexcrichton.com>", "Alex Crichton <alex@alexcrichton.com>",
"Gonzalo Brito Gadeschi <gonzalobg88@gmail.com>", "Gonzalo Brito Gadeschi <gonzalobg88@gmail.com>",

View File

@ -29,12 +29,12 @@ macro_rules! warning {
} }
fn read_and_watch_env(name: &str) -> Result<String, env::VarError> { 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) env::var(name)
} }
fn read_and_watch_env_os(name: &str) -> Option<OsString> { 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) env::var_os(name)
} }
@ -212,27 +212,27 @@ fn main() {
if !malloc_conf.is_empty() { if !malloc_conf.is_empty() {
info!("--with-malloc-conf={}", malloc_conf); 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") { if let Ok(lg_page) = read_and_watch_env("JEMALLOC_SYS_WITH_LG_PAGE") {
info!("--with-lg-page={}", 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") { if let Ok(lg_hugepage) = read_and_watch_env("JEMALLOC_SYS_WITH_LG_HUGEPAGE") {
info!("--with-lg-hugepage={}", 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") { if let Ok(lg_quantum) = read_and_watch_env("JEMALLOC_SYS_WITH_LG_QUANTUM") {
info!("--with-lg-quantum={}", 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") { if let Ok(lg_vaddr) = read_and_watch_env("JEMALLOC_SYS_WITH_LG_VADDR") {
info!("--with-lg-vaddr={}", 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 { if use_prefix {
@ -336,7 +336,7 @@ fn run(cmd: &mut Command) {
} }
fn execute(cmd: &mut Command, on_fail: impl FnOnce()) { fn execute(cmd: &mut Command, on_fail: impl FnOnce()) {
println!("running: {:?}", cmd); println!("running: {cmd:?}");
let status = match cmd.status() { let status = match cmd.status() {
Ok(status) => status, Ok(status) => status,
Err(e) => panic!("failed to execute command: {}", e), Err(e) => panic!("failed to execute command: {}", e),

View File

@ -15,15 +15,9 @@ fn background_threads_runtime_defaults() {
if !cfg!(feature = "background_threads_runtime_support") { if !cfg!(feature = "background_threads_runtime_support") {
// If the crate was compiled without background thread support, // If the crate was compiled without background thread support,
// then background threads are always disabled at run-time by default: // then background threads are always disabled at run-time by default:
assert_eq!(background_threads(), false); assert!(!background_threads());
return; return;
} }
if cfg!(feature = "background_threads") { assert_eq!(background_threads(), 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);
}
} }

View File

@ -9,7 +9,7 @@ static A: Jemalloc = Jemalloc;
fn smoke() { fn smoke() {
let layout = Layout::from_size_align(100, 8).unwrap(); let layout = Layout::from_size_align(100, 8).unwrap();
unsafe { unsafe {
let ptr = Jemalloc.alloc(layout.clone()); let ptr = Jemalloc.alloc(layout);
assert!(!ptr.is_null()); assert!(!ptr.is_null());
Jemalloc.dealloc(ptr, layout); Jemalloc.dealloc(ptr, layout);
} }

View File

@ -7,6 +7,7 @@ static A: Jemalloc = Jemalloc;
#[test] #[test]
fn smoke() { fn smoke() {
let mut a = Vec::new(); let mut a = Vec::new();
a.reserve(1);
a.push(3); a.push(3);
} }