This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: gcjik
- From: Per Bothner <per at bothner dot com>
- To: Adam Megacz <gcj at lists dot megacz dot com>
- Cc: java at gcc dot gnu dot org
- Date: Fri, 20 Sep 2002 13:19:27 -0700
- Subject: Re: gcjik
- References: <86bs6s33mv.fsf@nowhere.com>
Adam Megacz wrote:
I can do without the garbage collector; my main concern is
NullPointerException's. Is there some way to get gcc to emit a "if
null throw NullPointerException" before each object reference?
Performance isn't too important here.
-fcheck-references
Normally this is set as a configure-time default.
Also, other than having to tweak the GC, is there anything greviously
wrong with CNI code constructing a jvbytearray whose data pointer
points at arbitrary places in memory?
That woudl require serious changes to the array representation, since
a a Java array contains its element in the actual object, following the
object header, rather than indirectly referenced.
> For example, if I already have an array of bytes, and I want to share
> it with Java code without copying it.
You can use gnu.gcj.RawData as a 'void*' pointer to non-Java data,
which you can then access using native methods. You could write a
helper class to make this convenient.
This sounds like an interesting project, but be aware that neither
the compile-time verifier (in gcj) or the run-time verifier (in libgcj)
have been "vetted" for security. Specifically, I'm fairly sure we
don't handle interface types in gcj securely. And of course gcj and
libgcj are huge pieces of code, difficultle to audit for security.
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/