Skip to content

Commit 0a8f808

Browse files
Merge pull request #19605 from ChayimFriedman2/fix-sig
minor: Fix signature of libc memory usage function on Linux
2 parents 1748a84 + 1cb9b1c commit 0a8f808

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/profile/src/memory_usage.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ fn memusage_linux() -> MemoryUsage {
7878
let alloc = unsafe { libc::mallinfo() }.uordblks as isize;
7979
MemoryUsage { allocated: Bytes(alloc) }
8080
} else {
81-
let mallinfo2: fn() -> libc::mallinfo2 = unsafe { std::mem::transmute(mallinfo2) };
81+
let mallinfo2: extern "C" fn() -> libc::mallinfo2 =
82+
unsafe { std::mem::transmute(mallinfo2) };
8283
let alloc = mallinfo2().uordblks as isize;
8384
MemoryUsage { allocated: Bytes(alloc) }
8485
}

0 commit comments

Comments
 (0)