Closed Bug 875939 Opened 11 years ago Closed 11 years ago

Make the conversion operator on Rooted return a const ref

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file, 1 obsolete file)

Instead of a value. That way passing a Rooted<T> to a function taking |const T&| is not a GC hazard.
Comment on attachment 753956 [details] [diff] [review] Make passing a Rooted<T> to a function taking |const T&| not be a gc hazard. Review of attachment 753956 [details] [diff] [review]: ----------------------------------------------------------------- r=me ::: js/public/RootingAPI.h @@ +465,5 @@ > Rooted<T> *previous() { return prev; } > #endif > > + // Important: Return a reference here so passing a Rooted to > + // something that takes a const reference is not a GC hazard. All of the other comments in this file use /* */ style, so we should probably stick with that here.
Attachment #753956 - Flags: review?(terrence) → review+
Attachment #753984 - Flags: review?(terrence)
Attachment #753956 - Attachment is obsolete: true
Attachment #753984 - Flags: review?(terrence) → review+
Flags: in-testsuite-
Whiteboard: [need review]
Target Milestone: --- → mozilla24
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: