Closed Bug 866134 Opened 12 years ago Closed 12 years ago

GC: Address reported TokenStream::Position rooting hazards

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(1 file)

Attached patch Proposed changesSplinter Review
There are currently 9 hazards reported relating to TokenStream::Position. These are false positives since AutoKeepAtoms is in effect when TokenStream in use, so the atoms contained in Position are not going to be collected. To get rid of these hazards, I've made Position take a dummy AutoKeepAtoms reference in its constructor to ensure that one of these is present, and told the static analysis to regard it as rooted. I've also marked Position and AutoKeepAtoms as stack-only classes for good measure. I'm hoping you agree this is a sensible thing to do :-)
Attachment #742397 - Flags: review?(sphink)
Comment on attachment 742397 [details] [diff] [review] Proposed changes Review of attachment 742397 [details] [diff] [review]: ----------------------------------------------------------------- I like it. Requiring the AutoKeep reference makes it way harder to use this incorrectly in the future.
Attachment #742397 - Flags: review?(sphink) → review+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: