Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGC the rule tree only when the free list gets to a certain size. #14256
Conversation
highfive
commented
Nov 17, 2016
highfive
commented
Nov 17, 2016
|
Looks good to me with that comment added, and probably your patch imported too :) |
| @@ -533,6 +563,7 @@ impl Drop for StrongRuleNode { | |||
| Ordering::SeqCst); | |||
| if existing == next_free { | |||
| // Successfully inserted, yay! Otherwise try again. | |||
| root.free_count.fetch_add(1, Ordering::SeqCst); | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| /// just used as a heuristic to decide when to run GC.) | ||
| /// | ||
| /// Only used on the root RuleNode. | ||
| free_count: AtomicUsize, |
This comment has been minimized.
This comment has been minimized.
emilio
Nov 17, 2016
Member
Seems unfortunate to pay this price in every node only for this, probably we should be able to reuse one of the sibling pointers for that, but that's fine as a followup I guess. Could you leave a comment here on that?
| // the list, find a good heuristic here for that. | ||
| unsafe { shared_layout_context.style_context.stylist.rule_tree.gc() } | ||
| // GC the rule tree if some heuristics are met. | ||
| unsafe { shared_layout_context.style_context.stylist.rule_tree.maybe_gc(); } |
This comment has been minimized.
This comment has been minimized.
emilio
Nov 17, 2016
Member
I guess this will need the patch over in https://bugzilla.mozilla.org/show_bug.cgi?id=1318238 to avoid leaking right? Feel free to drop it here :)
This comment has been minimized.
This comment has been minimized.
|
@bors-servo try |
|
|
GC the rule tree only when the free list gets to a certain size. <!-- Please describe your changes on the following line: --> Use a heuristic similar to Gecko's to decide when to GC the rule tree. r? @emilio <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14256) <!-- Reviewable:end -->
|
|
|
@bors-servo try |
|
@bors-servo r=emilio |
|
|
GC the rule tree only when the free list gets to a certain size. <!-- Please describe your changes on the following line: --> Use a heuristic similar to Gecko's to decide when to GC the rule tree. r? @emilio <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14256) <!-- Reviewable:end -->
|
|
|
@bors-servo retry #14267 |
GC the rule tree only when the free list gets to a certain size. <!-- Please describe your changes on the following line: --> Use a heuristic similar to Gecko's to decide when to GC the rule tree. r? @emilio <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14256) <!-- Reviewable:end -->
|
|
|
@bors-servo retry |
GC the rule tree only when the free list gets to a certain size. <!-- Please describe your changes on the following line: --> Use a heuristic similar to Gecko's to decide when to GC the rule tree. r? @emilio <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14256) <!-- Reviewable:end -->
|
|
highfive
commented
Nov 19, 2016
|
|
@bors-servo retry |
GC the rule tree only when the free list gets to a certain size. <!-- Please describe your changes on the following line: --> Use a heuristic similar to Gecko's to decide when to GC the rule tree. r? @emilio <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14256) <!-- Reviewable:end -->
|
|
|
@bors-servo retry |
|
|
|
|
heycam commentedNov 17, 2016
•
edited by larsbergstrom
Use a heuristic similar to Gecko's to decide when to GC the rule tree.
r? @emilio
This change is