aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-03-02 18:27:51 -0700
committerbors-servo <metajack+bors@gmail.com>2015-03-02 18:27:51 -0700
commit290b025f8992569ed98a8556b70d5ebafb57a154 (patch)
tree56812f6e07a4043ee2d279d6b81b0fbc991fd389 /components
parent6927bf6ff0ba7232f9d201d6f71f57ce9146ce12 (diff)
parentdbc654ffa8960649ad9a74f964e8e44192717306 (diff)
downloadservo-290b025f8992569ed98a8556b70d5ebafb57a154.tar.gz
servo-290b025f8992569ed98a8556b70d5ebafb57a154.zip
auto merge of #5114 : psdh/servo/foldsum, r=jdm
Fix #5109
Diffstat (limited to 'components')
-rw-r--r--components/util/memory.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/util/memory.rs b/components/util/memory.rs
index e5e20d4cc94..c309cdbb4ed 100644
--- a/components/util/memory.rs
+++ b/components/util/memory.rs
@@ -7,6 +7,7 @@
use libc::{c_char,c_int,c_void,size_t};
use std::borrow::ToOwned;
use std::ffi::CString;
+use std::iter::AdditiveIterator;
use std::old_io::timer::sleep;
#[cfg(target_os="linux")]
use std::old_io::File;
@@ -380,7 +381,7 @@ fn get_resident_segments() -> Vec<(String, u64)> {
// from the "resident" measurement obtained via /proc/<pid>/statm in
// get_resident(). It's unclear why this difference occurs; for some
// processes the measurements match, but for Servo they do not.
- let total = segs.iter().fold(0u64, |total, &(_, size)| total + size);
+ let total = segs.iter().map(|&(_, size)| size).sum();
segs.push(("resident-according-to-smaps".to_owned(), total));
// Sort by size; the total will be first.