Closed
Bug 1332321
Opened 7 years ago
Closed 7 years ago
The *SKIPPABLE_*_INHERITED macros are footguns
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla54
People
(Reporter: bzbarsky, Assigned: bzbarsky)
Details
Attachments
(1 file)
If class A inherits from B, A uses one of the *SKIPPABLE_*_INHERITED macros, and B does _not_ use a skippable macro, then A's skippability stuff will never get called. That's because it's based on a boolean that only the least-derived CC participant gets to set. So you can write all this nice skippability code and have it all be dead code and never even notice.
Assignee | ||
Comment 1•7 years ago
|
||
One simple solution may be to just have a ctor for the participant that calls its parent participant ctor in a way that only skippable participants implement or something. Another is to make all participant ctors take a skippability arg and propagate it up with skippable things adding in "true" and the default value always being false or something. This would allow a skippable subclass of a non-skippable superclass and just invoke the canskip bits on the subclass.
Assignee | ||
Comment 2•7 years ago
|
||
This way we can't end up with a situation in which an ancestor doesn't care about skippability but a descendant does and doesn't get it, because the ancestor just claimed no skippability was needed.
Attachment #8829959 -
Flags: review?(continuation)
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Comment 3•7 years ago
|
||
Comment on attachment 8829959 [details] [diff] [review] Make all cycle collection participants explicitly say whether they need skippability themselves, or just want whatever skippability their descendants want Review of attachment 8829959 [details] [diff] [review]: ----------------------------------------------------------------- Thanks.
Attachment #8829959 -
Flags: review?(continuation) → review+
Pushed by bzbarsky@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/226f342c26fb Make all cycle collection participants explicitly say whether they need skippability themselves, or just want whatever skippability their descendants want. r=mccr8
Comment 5•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/226f342c26fb
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox54:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in
before you can comment on or make changes to this bug.
Description
•