stylo: Measure Elements and ComputedValues.

The patch provides FFI access to Gecko's SeenPtrs type from Rust, in
order to record what has already been measured when measuring Arcs. (The
SeenPtrs must be initialized on the Gecko side because the same table is
reused for measuring all Elements within a window, because Elements can
share ComputedValues.) I have confirmed with DMD that this is working
correctly.

The patch also introduces MallocSizeOfRepeats, which is like
MallocSizeOf but takes a SizeOfState, which holds a SeenPtrs table.
This commit is contained in:
Nicholas Nethercote 2017-08-02 16:42:09 +10:00
parent e07beacd4d
commit 526e9691f8
9 changed files with 161 additions and 5 deletions

View file

@ -6024,6 +6024,21 @@ pub mod root {
MAX = 29,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SeenPtrs {
pub _bindgen_opaque_blob: [u64; 6usize],
}
#[test]
fn bindgen_test_layout_SeenPtrs() {
assert_eq!(::std::mem::size_of::<SeenPtrs>() , 48usize , concat !
( "Size of: " , stringify ! ( SeenPtrs ) ));
assert_eq! (::std::mem::align_of::<SeenPtrs>() , 8usize , concat !
( "Alignment of " , stringify ! ( SeenPtrs ) ));
}
impl Clone for SeenPtrs {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug)]
pub struct URLExtraData {
pub mRefCnt: root::mozilla::ThreadSafeAutoRefCnt,