mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 18:43:01 +00:00
Merge pull request #19605 from ChayimFriedman2/fix-sig
minor: Fix signature of libc memory usage function on Linux
This commit is contained in:
commit
0a8f808ebc
1 changed files with 2 additions and 1 deletions
|
|
@ -78,7 +78,8 @@ fn memusage_linux() -> MemoryUsage {
|
|||
let alloc = unsafe { libc::mallinfo() }.uordblks as isize;
|
||||
MemoryUsage { allocated: Bytes(alloc) }
|
||||
} else {
|
||||
let mallinfo2: fn() -> libc::mallinfo2 = unsafe { std::mem::transmute(mallinfo2) };
|
||||
let mallinfo2: extern "C" fn() -> libc::mallinfo2 =
|
||||
unsafe { std::mem::transmute(mallinfo2) };
|
||||
let alloc = mallinfo2().uordblks as isize;
|
||||
MemoryUsage { allocated: Bytes(alloc) }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue