mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Measure memory usage of Stylo's Rule Tree.
This commit is contained in:
parent
5dee83d54d
commit
e08829703a
7 changed files with 126 additions and 10 deletions
|
@ -62,6 +62,7 @@ use gecko_bindings::structs::SeenPtrs;
|
|||
use gecko_bindings::structs::ServoBundledURI;
|
||||
use gecko_bindings::structs::ServoElementSnapshot;
|
||||
use gecko_bindings::structs::ServoElementSnapshotTable;
|
||||
use gecko_bindings::structs::ServoStyleSetSizes;
|
||||
use gecko_bindings::structs::SheetParsingMode;
|
||||
use gecko_bindings::structs::StyleBasicShape;
|
||||
use gecko_bindings::structs::StyleBasicShapeType;
|
||||
|
@ -2051,6 +2052,11 @@ extern "C" {
|
|||
RawServoDeclarationBlockBorrowed)
|
||||
-> ServoStyleContextStrong;
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_StyleSet_AddSizeOfExcludingThis(malloc_size_of: MallocSizeOf,
|
||||
sizes: *mut ServoStyleSetSizes,
|
||||
set: RawServoStyleSetBorrowed);
|
||||
}
|
||||
extern "C" {
|
||||
pub fn Servo_StyleContext_AddRef(ctx: ServoStyleContextBorrowed);
|
||||
}
|
||||
|
|
|
@ -5454,6 +5454,38 @@ pub mod root {
|
|||
"Alignment of field: " , stringify ! ( GeckoEffects )
|
||||
, "::" , stringify ! ( gecko ) ));
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy)]
|
||||
pub struct ServoStyleSetSizes {
|
||||
pub mStylistRuleTree: usize,
|
||||
pub mOther: usize,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_ServoStyleSetSizes() {
|
||||
assert_eq!(::std::mem::size_of::<ServoStyleSetSizes>() , 16usize ,
|
||||
concat ! (
|
||||
"Size of: " , stringify ! ( ServoStyleSetSizes ) ));
|
||||
assert_eq! (::std::mem::align_of::<ServoStyleSetSizes>() , 8usize
|
||||
, concat ! (
|
||||
"Alignment of " , stringify ! ( ServoStyleSetSizes )
|
||||
));
|
||||
assert_eq! (unsafe {
|
||||
& ( * ( 0 as * const ServoStyleSetSizes ) ) .
|
||||
mStylistRuleTree as * const _ as usize } , 0usize ,
|
||||
concat ! (
|
||||
"Alignment of field: " , stringify ! (
|
||||
ServoStyleSetSizes ) , "::" , stringify ! (
|
||||
mStylistRuleTree ) ));
|
||||
assert_eq! (unsafe {
|
||||
& ( * ( 0 as * const ServoStyleSetSizes ) ) . mOther
|
||||
as * const _ as usize } , 8usize , concat ! (
|
||||
"Alignment of field: " , stringify ! (
|
||||
ServoStyleSetSizes ) , "::" , stringify ! ( mOther )
|
||||
));
|
||||
}
|
||||
impl Clone for ServoStyleSetSizes {
|
||||
fn clone(&self) -> Self { *self }
|
||||
}
|
||||
#[repr(u8)]
|
||||
/// Enumeration that represents one of the two supported style system backends.
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||
|
|
|
@ -5342,6 +5342,38 @@ pub mod root {
|
|||
"Alignment of field: " , stringify ! ( GeckoEffects )
|
||||
, "::" , stringify ! ( gecko ) ));
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy)]
|
||||
pub struct ServoStyleSetSizes {
|
||||
pub mStylistRuleTree: usize,
|
||||
pub mOther: usize,
|
||||
}
|
||||
#[test]
|
||||
fn bindgen_test_layout_ServoStyleSetSizes() {
|
||||
assert_eq!(::std::mem::size_of::<ServoStyleSetSizes>() , 16usize ,
|
||||
concat ! (
|
||||
"Size of: " , stringify ! ( ServoStyleSetSizes ) ));
|
||||
assert_eq! (::std::mem::align_of::<ServoStyleSetSizes>() , 8usize
|
||||
, concat ! (
|
||||
"Alignment of " , stringify ! ( ServoStyleSetSizes )
|
||||
));
|
||||
assert_eq! (unsafe {
|
||||
& ( * ( 0 as * const ServoStyleSetSizes ) ) .
|
||||
mStylistRuleTree as * const _ as usize } , 0usize ,
|
||||
concat ! (
|
||||
"Alignment of field: " , stringify ! (
|
||||
ServoStyleSetSizes ) , "::" , stringify ! (
|
||||
mStylistRuleTree ) ));
|
||||
assert_eq! (unsafe {
|
||||
& ( * ( 0 as * const ServoStyleSetSizes ) ) . mOther
|
||||
as * const _ as usize } , 8usize , concat ! (
|
||||
"Alignment of field: " , stringify ! (
|
||||
ServoStyleSetSizes ) , "::" , stringify ! ( mOther )
|
||||
));
|
||||
}
|
||||
impl Clone for ServoStyleSetSizes {
|
||||
fn clone(&self) -> Self { *self }
|
||||
}
|
||||
#[repr(u8)]
|
||||
/// Enumeration that represents one of the two supported style system backends.
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue