mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
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:
parent
e07beacd4d
commit
526e9691f8
9 changed files with 161 additions and 5 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue