This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Creating an array in a pre allocated address
- From: Tom Tromey <tromey at redhat dot com>
- To: Gabriel Bianco <gabriel dot bianco at pixeon dot com dot br>
- Cc: java at gcc dot gnu dot org
- Date: Fri, 25 Jan 2008 11:35:21 -0700
- Subject: Re: Creating an array in a pre allocated address
- References: <479A2D74.3050801@pixeon.com.br>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Gabriel" == Gabriel Bianco <gabriel.bianco@pixeon.com.br> writes:
Gabriel> I think that in JNI I can do something similiar with
Gabriel> NewDirectByteBuffer(). Is there a function in CNI?
I suppose you could just do what the JNI code does:
using namespace gnu::gcj;
using namespace java::nio;
return new DirectByteBufferImpl$ReadWrite
(reinterpret_cast<RawData *> (address), length);
It might be a bit better to add a new CNI function to do this, then
have the JNI implementation call that. My reasoning here is that
perhaps we don't want to promise that the implementation details here
will change.
Tom