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: Storing C++ data in an instance field using CNI?


Bryce McKinlay writes:
 > 
 > I'm thinking of adding something like "RawDataMarked" which would be 
 > like RawData but would be checked by the GC. This way you could allocate 
 > a native struct using JvAllocBytes(), and it would be automatically 
 > freed when the Java object becomes unreachable. No need for a finalizer.
 > 
 > Thoughts?

I'm wondering why not use a jbyte[].  The advantage over a jbyte[] is

1.  efficiency?
2.  alignment, perhaps?


One related issue we might like to consider.

RawData is final.  I'm pretty sure this is wrong: being able to
subclass RawData would allow us to define typed pointers.  The use of
RawData to point to all manner of things with no type information does
no-one any good.

Andrew.


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