This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Java: Add heap dump and analyze support.



On Jan 23, 2007, at 3:42 PM, Tom Tromey wrote:


"Joel" == Joel Dice <dicej@mailsnare.net> writes:

Joel> This is actually something I've been curious about with respect Joel> to libgcj. My understanding is that internal linkage is Joel> deprecated in C++, with anonymous namespaces as the prefered Joel> mechanism. So I'm a bit suprised when I see new code that uses Joel> the former. Is this just a matter of being consistent with old Joel> code, or is there a technical reason?

libgcj is just old school.  I suppose if we were doing it over I would
push to put all the compiler API stuff into a namespace (instead of
having it all 'extern "C"') as well.

Joel> Does g++ produce better code when using internal linkage?

Not AFAIK.

G++ prior to 4.2 actually didn't mark symbols in anonymous namespaces as "internal", but it certainly does when symbols are marked 'static'. This could cause significant performance and size issues, depending on your code base. In LLVM, we've resorted to marking classes in anonymous namespaces as attribute(hidden) to work around this (because you can't mark a class 'static').


See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21581 and the related web of bugs.

-Chris


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]