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 Tue, 23 Jan 2007, David Daney wrote:
Tom Tromey wrote:

<snip>


David> +namespace gnu
David> +{
David> +  namespace gcj
David> +  {
David> +    namespace util
David> +    {
David> +      class GC_enumerator

This appears to be local to a single .cc file.  Do we need to put it
into a namespace like this?  I've always thought of these namespaces
as reserved for 'extern "Java"' code.


I didn't want to pollute the global namespace of libgcj. We know what is in gnu.gcj.util so there will be no collisions there.

Perhaps an anonymous namespace would be appropriate.


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

This patch is really cool, by the way.

- Joel


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