mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
layout: Report memory usage for fragment and box trees. (#36553)
Add memory reporter integration for the fragment and box trees that are persisted in the layout thread. Testing: Looked at the numbers for https://servo.org and https://html.spec.whatwg.org/. The former was very small, but the latter was 700mb. --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
add8c51f47
commit
c787688afc
33 changed files with 230 additions and 69 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
use app_units::Au;
|
||||
use base::print_tree::PrintTree;
|
||||
use malloc_size_of_derive::MallocSizeOf;
|
||||
use servo_arc::Arc as ServoArc;
|
||||
use style::properties::ComputedValues;
|
||||
|
||||
|
@ -14,6 +15,7 @@ use crate::geom::PhysicalRect;
|
|||
/// Can contain child fragments with relative coordinates, but does not contribute to painting
|
||||
/// itself. [`PositioningFragment`]s may be completely anonymous, or just non-painting Fragments
|
||||
/// generated by boxes.
|
||||
#[derive(MallocSizeOf)]
|
||||
pub(crate) struct PositioningFragment {
|
||||
pub base: BaseFragment,
|
||||
pub rect: PhysicalRect<Au>,
|
||||
|
@ -22,6 +24,7 @@ pub(crate) struct PositioningFragment {
|
|||
pub scrollable_overflow: PhysicalRect<Au>,
|
||||
|
||||
/// If this fragment was created with a style, the style of the fragment.
|
||||
#[conditional_malloc_size_of]
|
||||
pub style: Option<ServoArc<ComputedValues>>,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue