Shrink ElementData by moving pseudo count to type

`ElementStyles` holds an optional list of values for each eager pseudo-element.
However, the type was declared as a slice instead of a fixed size array, so an
extra 8 bytes were being allocated to hold the size, even though it never
changes.

Moving the constant size into the type reduces `ElementStyles` and `ElementData`
by 8 bytes.

MozReview-Commit-ID: GaO6DKFxUMo
This commit is contained in:
J. Ryan Stinnett 2017-06-20 14:02:45 -05:00
parent 2b5c56e6a8
commit 87c51bd8bf
2 changed files with 21 additions and 5 deletions

View file

@ -32,9 +32,9 @@ size_of_test!(test_size_of_rule, style::stylist::Rule, 32);
size_of_test!(test_size_of_option_arc_cv, Option<Arc<ComputedValues>>, 8);
size_of_test!(test_size_of_option_rule_node, Option<StrongRuleNode>, 8);
size_of_test!(test_size_of_element_styles, ElementStyles, 24);
size_of_test!(test_size_of_element_styles, ElementStyles, 16);
size_of_test!(test_size_of_restyle_data, RestyleData, 8);
size_of_test!(test_size_of_element_data, ElementData, 32);
size_of_test!(test_size_of_element_data, ElementData, 24);
size_of_test!(test_size_of_property_declaration, style::properties::PropertyDeclaration, 32);