Using the Vector API on (externally allocated) foreign memory

John Rose john.r.rose at oracle.com
Fri Mar 6 19:43:23 UTC 2020


On Mar 6, 2020, at 9:59 AM, Antoine Chambille <ach at activeviam.com> wrote:
> 
> Is support for vector operations on (externally allocated) foreign memory
> being considered? Have we missed something?

The current story is that you have to wrap a byte buffer around
your native memory, using JNI’s NewDirectByteBuffer.  Please
let us know if that doesn’t work for you.

It is likely that vectors will interoperate with a more modern API
for both on-heap and off-heap access, after it settles.  These “memory
segments” are incubating in JDK 14:

https://download.java.net/java/GA/jdk14/docs/api/jdk.incubator.foreign/jdk/incubator/foreign/MemorySegment.html

— John


More information about the panama-dev mailing list