Commit graph

105 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
65f239c9e1
style: Don't assume siblings are alive in the rule tree when removing ourselves from the child list.
We can't assume all our siblings are alive because they may very well be in the
free list too.

This tempts to happen when the rule nodes are destroyed as part of the last GC,
the one that runs in the root destructor.

Also, properly put the next sibling back into the list when the rules are GCd.
2016-11-10 17:56:54 +01:00
Simon Sapin
1a18161006 rule tree: more descriptive field names 2016-11-05 17:29:56 +01:00
Simon Sapin
2dd2c9cedd Simplify rule_tree::StyleSourceGuardHandle 2016-11-05 17:29:55 +01:00
Simon Sapin
98bd99b74c rule tree: Remove unsound transmute()
RuleTreeDeclarationsIterator would yield &PropertyDeclaration
with the lifetime of the rule tree, but the reference would only
be valid as long as the iterator was holding the corresponding lock.

The lock would be released when the iterator’s `.next()` method
moves to the next rule tree node, or when  the iterator is dropped.

Also change apply_declaration to not require a `Clone` iterator
(since closures unfortunately don’t implement `Clone`).
Instead have it take a callable that returns a fresh iterator.
2016-11-05 17:29:54 +01:00
Emilio Cobos Álvarez
de4fe6e2b6 Concurrent rule tree, v1
This patch introduces infrastructure for the rule tree, and constructs it.

We don't use it yet, nor have good heuristics for GC'ing it, but this should not
happen anymore once we store the rule node reference in the node.

I haven't messed up with memory orders because I want to do a try run with it,
then mess with them.

Take down the ApplicableDeclarationsCache, use the rule tree for doing the cascade.
2016-11-05 17:29:52 +01:00