RFC: Make gnu.classpath.Pointer work
Gary Benson
gbenson@redhat.com
Wed Jan 17 16:55:00 GMT 2007
Tom Tromey wrote:
> >>>>> "Gary" == Gary Benson <gbenson@redhat.com> writes:
>> Gary> Is this patch all that's needed to make gnu.classpath.Pointer
> Gary> an analogue of gnu.gcj.RawData?
>> I don't think Pointer works like RawData, and without extra work on
> the JNI code, this patch will result in bugs. Furthermore I think
> it would probably be more trouble than benefit to actually do this
> work on the JNI code, since it would mean keeping a divergence
> around forever.
>> Pointer is a base class with 2 concrete subclasses: Pointer32 and
> Pointer64. The Classpath JNI code creates an instance of one of
> these subclasses depending on the system it is running on. Each
> of the subclasses is just a plain old Java class, and each wraps a
> value (either int or long) which is a cast C pointer. When a real
> C pointer is needed, the value is extracted and cast back. See
> jni/classpath/jcl.c.
Ooooh, I didn't realise. I looked in Pointer.java, saw it was
an empty class, and assumed it was the same thing as RawData.
Thanks, and sorry for the noise,
Gary
More information about the Java
mailing list