Closed Bug 1008420 Opened 6 years ago Closed 6 years ago

Split out a refcountless nsArray base class

Categories

(Core :: XPCOM, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

Attachments

(2 files)

I keep needing this, so I should just get it reviewed and landed.
Currently, nsArray uses threadsafe refcounting, while nsArrayCC uses non-threadsafe refcounting, but inherits from nsArray, thus shadowing the refcounting implementation of nsArray.  I am going to create a new nsArrayBase class that has no refcounting, and then make nsArray and nsArrayCC inherit from it.
I don't understand. The only reason I can see somebody needing nsArray is because you need to pass it around to scriptable stuff. Otherwise why not just use nsTArray?

Arguably we should get rid of nsIArray/nsArray/nsArrayCC altogether.
I don't know why anybody uses it, I'm just trying to get rid of the shadowing of mRefCnt.
(Because if I can statically prevent the shadowing of mRefCnt I can prevent a certain class of cycle collector errors like bug 1004630.)
I'll give bsmedberg the right of first refusal here, in case he has some objections.

try run: https://tbpl.mozilla.org/?tree=Try&rev=6cabd1d69357
Attachment #8420656 - Flags: review?(benjamin)
Attachment #8420656 - Flags: review?(benjamin) → review+
Attachment #8420657 - Flags: review?(benjamin) → review+
You need to log in before you can comment on or make changes to this bug.