CNI Memory Management

Bryce McKinlay bryce@mckinlay.net.nz
Thu Jun 12 00:12:00 GMT 2003


On Thursday, June 12, 2003, at 12:07 PM, Craig A. Vanderborgh wrote:

> My JNI-to-CNI porting work is going very well.  CNI is a wonderful
> thing, at least compared to JNI!!
>
> Anyway, my question is this:  When I use things like JvNewByteArray() 
> to
> create a byte array, do I have to free it when I'm finished using it?
> Or are such CNI allocations handled by GC?

Yes - Java objects are always allocated by the GC. JvNewByteArray() is 
no exception - think of it as the CNI equivalent of "new byte[...]" in 
Java.

Bryce.



More information about the Java mailing list