Open Bug 1712175 Opened 3 years ago Updated 3 years ago

Treat RefPtr and nsCOMPtr as unsafe as UniquePtr, unless guarded by HoldJSObjects

Categories

(Core :: JavaScript: GC, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: sfink, Unassigned)

References

(Blocks 1 open bug)

Details

Currently, the hazard analysis complains about having a UniquePtr<T> live across a GC call if T contains any unrooted pointers. The idea is that during a GC, we need to trace the T to update its pointers, and that's very unlikely to happen. (Note that Rooted<UniquePtr<T>> works and is understood.)

Nika pointed out that RefPtr and nsCOMPtr are similarly unsafe, though they are commonly used for this purpose and the rooting needs are normally handled via HoldJSObjects, which will require special detection.

Severity: -- → S4
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.