libjava status on Solaris 8/Intel and IRIX 6.5

Andrew Haley aph@cambridge.redhat.com
Mon Mar 18 15:24:00 GMT 2002


Tom Tromey writes:
 > >>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:
 > 
 > >> void barf (java::lang::grope *poo)
 > >> {
 > >> ref<java::lang::grope> no_really = poo;
 > >> 
 > >> ... hope you don't use `poo' by mistake in here, since it will
 > >> silently "work" ...
 > >> 
 > >> }
 > 
 > Andrew> I don't understand.  Why won't using a smart pointer as the
 > Andrew> arg work?
 > 
 > If this is a method, which most CNI code is, then the name of the
 > method must mangle in a way compatible with gcj.  I guess we could
 > change the gcj mangling algorithm.

Well yes, absolutely.  I'm suggesting migrating CNI from C-style
pointers to a C++ smart pointer type like ref<T>.  Surely that's the
right thing to do in the long term.

I suppose an alternative in the meantime is some sort of macro magic
that generated both the headers for a function -- with weird names for
the actual args -- and the code to copy from the args to the more
sensibly named smart pointers that are used in the function.

Andrew.



More information about the Java mailing list