From ba71eb21b083c9fe4c360a1996e9809faab92741 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Wed, 15 Jul 2015 10:08:45 +0200 Subject: [PATCH] Initialize info directly in get_system_heap_allocated. --- components/profile/mem.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/profile/mem.rs b/components/profile/mem.rs index e3330531db0..00a5c51f14b 100644 --- a/components/profile/mem.rs +++ b/components/profile/mem.rs @@ -375,10 +375,9 @@ mod system_reporter { #[cfg(target_os="linux")] fn get_system_heap_allocated() -> Option { - 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