This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Make gnu.classpath.Pointer work


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


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