mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: Move size of tests to compile-time tests in the style crate
Same reasoning as the previous commit. Differential Revision: https://phabricator.services.mozilla.com/D146104
This commit is contained in:
parent
50d31686be
commit
f48b95e2e3
13 changed files with 53 additions and 49 deletions
|
@ -203,9 +203,6 @@ impl RuleTree {
|
|||
/// where it likely did not result from a rigorous performance analysis.)
|
||||
const RULE_TREE_GC_INTERVAL: usize = 300;
|
||||
|
||||
/// Used for some size assertions.
|
||||
pub const RULE_NODE_SIZE: usize = std::mem::size_of::<RuleNode>();
|
||||
|
||||
/// A node in the rule tree.
|
||||
struct RuleNode {
|
||||
/// The root node. Only the root has no root pointer, for obvious reasons.
|
||||
|
@ -768,3 +765,8 @@ impl hash::Hash for StrongRuleNode {
|
|||
(&*self.p as *const RuleNode).hash(state)
|
||||
}
|
||||
}
|
||||
|
||||
// Large pages generate thousands of RuleNode objects.
|
||||
size_of_test!(RuleNode, 80);
|
||||
// StrongRuleNode should be pointer-sized even inside an option.
|
||||
size_of_test!(Option<StrongRuleNode>, 8);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue