Overhaul ComputedValues measurement, and add style structs measurement.

This commit is contained in:
Nicholas Nethercote 2017-08-14 10:49:48 +10:00
parent 60c44b072c
commit 1a40101d2f
4 changed files with 77 additions and 44 deletions

View file

@ -60,7 +60,6 @@ use selector_parser::PseudoElement;
use servo_arc::{Arc, RawOffsetArc};
use std::mem::{forget, uninitialized, transmute, zeroed};
use std::{cmp, ops, ptr};
use stylesheets::{MallocSizeOfWithRepeats, SizeOfState};
use values::{self, Auto, CustomIdent, Either, KeyframesName};
use values::computed::{NonNegativeAu, ToComputedValue, Percentage};
use values::computed::effects::{BoxShadow, Filter, SimpleShadow};
@ -369,18 +368,6 @@ impl ComputedValuesInner {
}
}
impl MallocSizeOfWithRepeats for ComputedValues {
fn malloc_size_of_children(&self, state: &mut SizeOfState) -> usize {
let mut n = 0;
if let Some(ref raw_offset_arc) = *self.get_raw_visited_style() {
n += raw_offset_arc.with_arc(|a: &Arc<ComputedValues>| {
a.malloc_size_of_children(state)
})
}
n
}
}
<%def name="declare_style_struct(style_struct)">
pub use ::gecko_bindings::structs::mozilla::Gecko${style_struct.gecko_name} as ${style_struct.gecko_struct_name};
impl ${style_struct.gecko_struct_name} {