Skip to content

Commit ffa39d4

Browse files
committed
Auto merge of #133770 - GuillaumeGomez:rollup-l62iyyx, r=GuillaumeGomez
Rollup of 10 pull requests Successful merges: - #131713 (Stabilize `const_maybe_uninit_write`) - #133535 (show forbidden_lint_groups in future-compat reports) - #133610 (Move `Const::{from_anon_const,try_from_lit}` to hir_ty_lowering) - #133701 (Use c"lit" for CStrings without unwrap) - #133704 (fix ICE when promoted has layout size overflow) - #133705 (add "profiler" and "optimized-compiler-builtins" option coverage for ci-rustc) - #133710 (Reducing `target_feature` check-cfg merge conflicts) - #133732 (Fix `-Zdump-mir-dataflow`) - #133746 (Change `AttrArgs::Eq` to a struct variant) - #133763 (Fix `f16::midpoint` const feature gate) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 820353a + 445b974 commit ffa39d4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

crates/profile/src/memory_usage.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,13 @@ fn memusage_linux() -> MemoryUsage {
6262
// mallinfo2 is very recent, so its presence needs to be detected at runtime.
6363
// Both are abysmally slow.
6464

65-
use std::ffi::CStr;
6665
use std::sync::atomic::{AtomicUsize, Ordering};
6766

6867
static MALLINFO2: AtomicUsize = AtomicUsize::new(1);
6968

7069
let mut mallinfo2 = MALLINFO2.load(Ordering::Relaxed);
7170
if mallinfo2 == 1 {
72-
let cstr = CStr::from_bytes_with_nul(b"mallinfo2\0").unwrap();
73-
mallinfo2 = unsafe { libc::dlsym(libc::RTLD_DEFAULT, cstr.as_ptr()) } as usize;
71+
mallinfo2 = unsafe { libc::dlsym(libc::RTLD_DEFAULT, c"mallinfo2".as_ptr()) } as usize;
7472
// NB: races don't matter here, since they'll always store the same value
7573
MALLINFO2.store(mallinfo2, Ordering::Relaxed);
7674
}

0 commit comments

Comments
 (0)