mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #6850 - servo:rustup_2015-07-30, r=SimonSapin
Upgrade to rustc 1.3.0-dev (87055a68c 2015-07-30) This builds and passes unit tests. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6850) <!-- Reviewable:end -->
This commit is contained in:
commit
4837dd9a1c
23 changed files with 211 additions and 106 deletions
|
@ -313,14 +313,15 @@ impl ReportsForest {
|
|||
|
||||
// Insert the path and size into the forest, adding any trees and nodes as necessary.
|
||||
fn insert(&mut self, path: &[String], size: usize) {
|
||||
let (head, tail) = path.split_first().unwrap();
|
||||
// Get the right tree, creating it if necessary.
|
||||
if !self.trees.contains_key(&path[0]) {
|
||||
self.trees.insert(path[0].clone(), ReportsTree::new(path[0].clone()));
|
||||
if !self.trees.contains_key(head) {
|
||||
self.trees.insert(head.clone(), ReportsTree::new(head.clone()));
|
||||
}
|
||||
let t = self.trees.get_mut(&path[0]).unwrap();
|
||||
let t = self.trees.get_mut(head).unwrap();
|
||||
|
||||
// Use tail() because the 0th path segment was used to find the right tree in the forest.
|
||||
t.insert(path.tail(), size);
|
||||
// Use tail because the 0th path segment was used to find the right tree in the forest.
|
||||
t.insert(tail, size);
|
||||
}
|
||||
|
||||
fn print(&mut self) {
|
||||
|
@ -499,6 +500,13 @@ mod system_reporter {
|
|||
($e:expr) => (match $e { Some(e) => e, None => return None })
|
||||
);
|
||||
|
||||
#[cfg(target_os="linux")]
|
||||
fn page_size() -> usize {
|
||||
unsafe {
|
||||
::libc::sysconf(::libc::_SC_PAGESIZE) as usize
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os="linux")]
|
||||
fn get_proc_self_statm_field(field: usize) -> Option<usize> {
|
||||
use std::fs::File;
|
||||
|
@ -509,7 +517,7 @@ mod system_reporter {
|
|||
option_try!(f.read_to_string(&mut contents).ok());
|
||||
let s = option_try!(contents.split_whitespace().nth(field));
|
||||
let npages = option_try!(s.parse::<usize>().ok());
|
||||
Some(npages * ::std::env::page_size())
|
||||
Some(npages * page_size())
|
||||
}
|
||||
|
||||
#[cfg(target_os="linux")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue