classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: VM support for GetDirectBufferAddress


From: Michael Koch
Subject: Re: VM support for GetDirectBufferAddress
Date: Thu, 6 Jan 2005 17:48:47 +0100
User-agent: KMail/1.7.1

Am Donnerstag, 6. Januar 2005 17:34 schrieb Archie Cobbs:
> Jeroen Frijters wrote:
> > In that case, IKVM is broken too. I didn't know that it was legal
> > to pass views to GetDirectBufferAddress. The documentation isn't
> > exactly very clear on this.
>
> Hmm.. since this code will be so Classpath-specific, perhaps
> Classpath should provide the code to handle it.
>
> E.g., Classpath could provide a new class VMDirectBuffer that
> contained methods which would be invoked by the VM itself in order
> to implement GetDirectBufferAddress() and 
> GetDirectBufferCapacity(). After all, the logic to retrieve this
> information is "known" to Classpath, not to the VM (i.e., the VM
> would have to be written to a specific version of Classpath,
> assumptions about java.nio object fields, etc).
>
> Does this sound feasible? I'm new to this NIO stuff so this idea
> might be random and completely wrong.

this means putting another layer into this. The VM needs only to do aa 
simple malloc() operation and the give the result to a constructor of 
java.nio.DirectByteBufferImpl (that's the code fore 
NewDirectByteBuffer() in human language). Its too trivial. The other 
two methods are similar trivial. Putting a special layer into this is 
too much overhead IMO. What we can do s to provide default 
implementations for these methods. Then was VM supporting JNI can use 
them. Each VM not supporting JNI don't needs them anyway.


Michael
-- 
Homepage: http://www.worldforge.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]