Initialize info directly in get_system_heap_allocated.

This commit is contained in:
Ms2ger 2015-07-15 10:08:45 +02:00
parent da5f1abaa7
commit ba71eb21b0

View file

@ -375,10 +375,9 @@ mod system_reporter {
#[cfg(target_os="linux")] #[cfg(target_os="linux")]
fn get_system_heap_allocated() -> Option<usize> { fn get_system_heap_allocated() -> Option<usize> {
let mut info: struct_mallinfo; let info: struct_mallinfo = unsafe {
unsafe { mallinfo()
info = mallinfo(); };
}
// The documentation in the glibc man page makes it sound like |uordblks| // 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 // 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 // the brk heap. We need |hblkhd| as well to get the larger allocations