mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Initialize info directly in get_system_heap_allocated.
This commit is contained in:
parent
da5f1abaa7
commit
ba71eb21b0
1 changed files with 3 additions and 4 deletions
|
@ -375,10 +375,9 @@ mod system_reporter {
|
|||
|
||||
#[cfg(target_os="linux")]
|
||||
fn get_system_heap_allocated() -> Option<usize> {
|
||||
let mut info: struct_mallinfo;
|
||||
unsafe {
|
||||
info = mallinfo();
|
||||
}
|
||||
let info: struct_mallinfo = unsafe {
|
||||
mallinfo()
|
||||
};
|
||||
// The documentation in the glibc man page makes it sound like |uordblks|
|
||||
// would suffice, but that only gets the small allocations that are put in
|
||||
// the brk heap. We need |hblkhd| as well to get the larger allocations
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue