This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Storing C++ data in an instance field using CNI?
>>>>> "Paul" == Paul Gear <paul@gear.dyndns.org> writes:
Paul> More questions along the same topic: has _Jv_AllocBytes been deprecated
Paul> or something? It appears in the doco at
Paul> http://gcc.gnu.org/java/papers/cni/t1308.html
Paul> and
Paul> http://gcc.gnu.org/onlinedocs/gcj/Object-allocation.html#Object%20allocation
Paul> but when i try to use it it is not defined.
It isn't declared in cni.h. IMO we shouldn't document or export any
_Jv_ function, only `Jv' functions.
Paul> Also, assuming _Jv_AllocBytes() is still the right thing to use, does it
Paul> return zeroed memory?
Yes, it does.
I'm not sure this is what you want. It doesn't make sense to store
the result of _Jv_AllocBytes in a RawData field. Those fields aren't
scanned, and as _Jv_AllocBytes returns collectible memory, it won't be
considered live. You probably just want JvMalloc or plain old malloc.
Tom