Closed
Bug 184002
Opened 22 years ago
Closed 22 years ago
configure test for extern template specializations
Categories
(SeaMonkey :: Build Config, defect)
SeaMonkey
Build Config
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla1.3beta
People
(Reporter: benjamin, Assigned: netscape)
References
Details
Attachments
(1 file, 2 obsolete files)
1.65 KB,
patch
|
scc
:
review+
|
Details | Diff | Splinter Review |
For bug 180264 I will need a configure test, whether compilers support extern template specializations. I have a patch that I think will work.
Reporter | ||
Comment 1•22 years ago
|
||
Assignee | ||
Comment 2•22 years ago
|
||
Our resident language lawyers will have to review the test. I'm not worthy.
Comment 3•22 years ago
|
||
bbaetz is another great guy to review this.
Comment 4•22 years ago
|
||
I'm confused. I don't see this used in teh patch on bug 180264. From that bug: "If the compiler does not support this syntax, we can degrade gracefully by omitting the extern declaration (at the price of a little code duplication): extern template myClass<T>;" I'm not really sure that that will work, though. |extern template| is an extention, AFAIK - does it even mean the same thing on all compilers? I'm also not sure how much code duplication there will be, anyway - g++ uses .linkonce sections to only have the resulting function appear once anyway. Won't the |extern| suppress inlining, though, whcih is what you're trying to avoid for bug 180264? (I'm not too sure about that bit, though)
Reporter | ||
Comment 5•22 years ago
|
||
The basic idea of this syntax is to avoid duplicate instantiations of template functions *across shared-libraries*. Compilers fold duplicate instantiations within a single library, but not across shared libraries. Instantiate all of the common templatizations of nsTHashtable within the XPCOM shared lib, and it won't need to be duplicated in other shared libs. "extern template class" is an extension, but it has a standard meaning on GCC and MSVC: it declares all the class functions with external linkage, just like "extern var". I want to add this test to bug 180264, because I know that this syntax breaks mac compilers, and others I'm sure. I would wrap the "extern template class" declarations in an #ifdef HAVE_CPP_EXTERN_INSTANTIATION to protect Mac and other compilers that don't support the external linkage. > Won't the |extern| suppress inlining, though, whcih is what you're trying to > avoid for bug 180264? (I'm not too sure about that bit, though) "extern class" shouldn't suppress inlining, but that isn't the point of bug 180264 in any case. That bug avoids multiple heap allocations in hashtables, by allocating keys and data "inline" in the hashtable.
Reporter | ||
Comment 6•22 years ago
|
||
I forgot, that since we don't support configure tests for MSVC, that it had to be declared manually in nscore.h for Win32 platforms.
Reporter | ||
Updated•22 years ago
|
Attachment #108552 -
Attachment is obsolete: true
Reporter | ||
Updated•22 years ago
|
Attachment #108894 -
Flags: review?(dbaron)
Reporter | ||
Comment 7•22 years ago
|
||
Same patch, without carriage returns.
Attachment #108894 -
Attachment is obsolete: true
Reporter | ||
Updated•22 years ago
|
Attachment #108894 -
Flags: review?(dbaron)
Reporter | ||
Updated•22 years ago
|
Attachment #109224 -
Flags: review?(scc)
Comment 8•22 years ago
|
||
Comment on attachment 109224 [details] [diff] [review] patch -u without CRs and did you find that the results from this test matched the actual capabilities of the compilers? It looks like a reasonable test to me. r=scc
Attachment #109224 -
Flags: review?(scc) → review+
Comment 9•22 years ago
|
||
depending on the result of discussion about maintaining the classic Mac build, I'll test Metrowerks for compliance and add the appropriate declaration to the Mac flags section
Assignee | ||
Comment 10•22 years ago
|
||
Patch has been checked in.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.3beta
Reporter | ||
Comment 11•22 years ago
|
||
Verifying... tinderbox logs look reasonable. Thanks, cls and scc!
Status: RESOLVED → VERIFIED
Updated•20 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•