This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
RE: JNI patches
- To: "'Jeff Sturm'" <jsturm at one-point dot com>, java at gcc dot gnu dot org
- Subject: RE: JNI patches
- From: "Boehm, Hans" <hans_boehm at hp dot com>
- Date: Tue, 3 Apr 2001 09:09:34 -0700
Good point.
Another alternative on many platforms is to treat all writable regions of
memory (that aren't part of the garbage collected heap) as roots. This
requires something like a /proc interface to find the writable mappings.
The code to do this under Linux and a few other systems is mostly there.
(This is basically how things work under win32 and Irix anyway.)
But I think we are all in agreement that this is mostly a solution in search
of a problem. So long as most of the standard libraries use CNI, and JNI is
thus not a performance bottleneck, the more conventional the JNI
implementation, the better.
Hans
> -----Original Message-----
> From: Jeff Sturm [mailto:jsturm@one-point.com]
> Sent: Monday, April 02, 2001 4:53 PM
> To: java@gcc.gnu.org
> Subject: RE: JNI patches
>
>
>
>
> On Mon, 2 Apr 2001, Boehm, Hans wrote:
> > The collector normally does not scan objects allocated with
> C malloc (except
> > on one or two platforms where that's hard to avoid). The
> easiest way to
> > change that is to redirect the C malloc to
> GC_malloc_uncollectable, but that
> > sometimes creates startup ordering issues. It should work
> on Linux, but I'm
> > not sure about various other platforms.
>
> It's not a general solution. For one thing, with JNI
> invocation programs
> are free to startup (and bind to malloc, etc.) before loading the gcj
> runtime.
>
> I don't see how local refs are avoidable if JNI is going to
> work. There
> are probably faster ways to handle them, though. (I'm not
> worried about
> global refs, which are relatively uncommon.)
>
> Jeff
>
>