Implement no copy memory

Florian Weimer fweimer at redhat.com
Tue May 21 12:11:21 UTC 2019


* Ardika Rommy Sanjaya:

> Hi,
>
> I want to do packet parsing manualy (not using Layout).
>
>> Wouldn't it make sense for packet parsing to construct a ByteBuffer
>> first, and do the parsing using that?
>
> Yes, I saw that DirectByteBuffer using jdk.internal.misc.Unsafe. But
> why jdk.internal.misc.Unsafe is not exported in module-info.java? is
> it because security reason?  Hopefully one day it will exported,
> because sun.misc.Unsafe is deprecated.

Maurizio has already mentioned the support way to get access to a byte
buffer:

>  If you want to go the byte-buffer way, there's a way to do that too,
>  using the Pointer::asDirectByteBuffer method.
>
>  http://hg.openjdk.java.net/panama/dev/file/c65ecdbf4155/src/java.base/share/classes/java/foreign/memory/Pointer.java#l217

Thanks,
Florian


More information about the panama-dev mailing list