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


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

Re: C++ and Java CNI: Check Java references


Mark Mitchell writes:
 > >>>>> "Per" == Per Bothner <per@bothner.com> writes:
 > 
 >     Per> from the source.  However, explicit null-pointer checking
 >     Per> seems to stretch the boundary of appropriate magic re-writes.
 > 
 > FWIW, I agree with Per.  I would prefer not to see this patch
 > installed.
 > 
 > Instead, I would suggest that CNI programmers use C++ features, i.e.,
 > smart pointers, to do the job.

I can see the logic here, but doesn't it amount to a redesign of CNI?

This:

jobjectArray
java::io::File::performList (java::io::FilenameFilter *filter, 
			     java::io::FileFilter *fileFilter, 
			     java::lang::Class *result_type)

would become this:

jobjectArray
java::io::File::performList (JavaPointer<java::io::FilenameFilter> filter, 
			     JavaPointer<java::io::FileFilter> fileFilter, 
			     JavaPointer<java::lang::Class> result_type)

Hmm.  I guess it doesn't look too awful.

Andrew.


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