Closed Bug 820403 Opened 13 years ago Closed 13 years ago

replace some nsISupportsArray members with nsCOMArrays

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: tbsaunde, Assigned: tbsaunde)

References

Details

Attachments

(3 files)

No description provided.
Attachment #690897 - Flags: review?(ehsan) → review+
Comment on attachment 690899 [details] [diff] [review] remove nsISupportsArray members in nsFormFillController Review of attachment 690899 [details] [diff] [review]: ----------------------------------------------------------------- Actually, you should probably convert these to nsTArray<nsCOMPtr<nsIFoo> > so that the arrays have the same interface as nsCOMArray. We should not add more nsCOMArray's to the code base, and I was stupid for not thinking of this sooner. :(
Attachment #690899 - Flags: review?(ehsan) → review-
Attachment #690897 - Flags: review+ → review-
Ehsan really? I thought that we still preferred nsCOMArray to nsTArray<nsCOMPtr>.
(In reply to comment #4) > Ehsan really? I thought that we still preferred nsCOMArray to > nsTArray<nsCOMPtr>. Do we? I thought we hated nsCOMArray because its interface is different to nsTArray which is what people are used to! :-) Hrm, let me put it this way, if I came up with a patch which converted all nsCOMArray's to nsTArray<nsCOMPtr>'s, and typedef'ed nsCOMArray<T> to nsTArray<nsCOMPtr<T> > (let's pretend that C++ lets us define such a typedef ;-), would you take that patch?
Yeah, the different interface is awful. We should just have one array class and typedef if people like the way that 'nsCOMArray' sounds.
(In reply to Ehsan Akhgari [:ehsan] from comment #5) > Hrm, let me put it this way, if I came up with a patch which converted all > nsCOMArray's to nsTArray<nsCOMPtr>'s, and typedef'ed nsCOMArray<T> to > nsTArray<nsCOMPtr<T> > (let's pretend that C++ lets us define such a typedef > ;-), would you take that patch? I actually started looking at that, but there was too much to do, so I focused on the smaller task of eliminating voidArray, in bug 819090.
Comment on attachment 690897 [details] [diff] [review] remove nsISupportsArray members in nsFileView.cpp FWIW, this patch is more-or-less what was done in bug 792566; that patch used nsTArray.
Attachment #691194 - Flags: review?(ehsan) → review+
(In reply to Nathan Froyd from comment #8) > Comment on attachment 690897 [details] [diff] [review] > remove nsISupportsArray members in nsFileView.cpp > > FWIW, this patch is more-or-less what was done in bug 792566; that patch > used nsTArray. No, this patch is way better than the one in bug 792566 :-P
(In reply to Ehsan Akhgari from comment #5) > Hrm, let me put it this way, if I came up with a patch which converted all > nsCOMArray's to nsTArray<nsCOMPtr>'s, and typedef'ed nsCOMArray<T> to > nsTArray<nsCOMPtr<T> > (let's pretend that C++ lets us define such a typedef > ;-), would you take that patch? Although it does at least now support SafeElementAt, nsTArray still doesn't have all the APIs that nsCOMArray does. (In fact, nsISupportsArray has an API that no other array does, forcing Standard8 to emulate it in bug 820377...)
AIUI, the big problem with nsTArray<nsCOMPtr> was that it hurt codesize in a rather significant way. The underlying comarray-base which saves everything as an array of nsISupports means that the different template versions of nsCOMArray are basically free. It also means that things like bug 820674 can operate on the generic base rather than on the specialized class, so you don't have extra codesize penalties for those. This isn't so much of an issue with the MSVC because of COMDAT folding, but none of the GCC/clang toolchains do anything equivalent, as far as I know. If you just made the nsCOMArray API match nsTArray, that would be excellent, but still a lot of work.
(In reply to Benjamin Smedberg [:bsmedberg] from comment #13) > This isn't so much of an issue with the MSVC because of COMDAT folding, but > none of the GCC/clang toolchains do anything equivalent, as far as I know. FWIW, gold on Linux will do this if you ask it to.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
(In reply to comment #14) > (In reply to Benjamin Smedberg [:bsmedberg] from comment #13) > > This isn't so much of an issue with the MSVC because of COMDAT folding, but > > none of the GCC/clang toolchains do anything equivalent, as far as I know. > > FWIW, gold on Linux will do this if you ask it to. Do we? :-)
(In reply to Ehsan Akhgari [:ehsan] from comment #16) > (In reply to comment #14) > > (In reply to Benjamin Smedberg [:bsmedberg] from comment #13) > > > This isn't so much of an issue with the MSVC because of COMDAT folding, but > > > none of the GCC/clang toolchains do anything equivalent, as far as I know. > > > > FWIW, gold on Linux will do this if you ask it to. > > Do we? :-) It looks like we do: http://mxr.mozilla.org/mozilla-central/source/build/autoconf/compiler-opts.m4#111
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: