File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments