On 24.03.2010, at 11:22, mac wrote:

> With regards to copying of data, clj-native expects nio buffers to be
> used as input where a native function requires a typed pointer. These
> buffers can be allocated outside of the JVM heap specifically to avoid
> copying. For example (ByteBuffer/allocateDirect 1000) will allocate
> 1000 bytes outside of the JVM heap, which means it does not have to be
> copied during native interop because the GC will never move it.

OK, that clarifies how it works, thanks!

The essential question thus is how fast get and put operations to a direct 
buffer are, compared to an access to an array element. If the difference is not 
important, one could indeed use direct buffers for storing big data objects and 
access them efficiently from both sides of the interface.

Konrad.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to