Implement no copy memory

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue May 21 12:26:32 UTC 2019


On 21/05/2019 13:09, Ardika Rommy Sanjaya wrote:
> 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.
>
jdk.internal.misc.Unsafe is not exported because is an internal API, 
which got encapsulated in the transition from Java 8 to Java 9. You can 
read all about it in this JEP:

https://openjdk.java.net/jeps/260

The path forward is not in exporting jdk.internal.misc.Unsafe, but to 
create viable alternatives for the functionalities available in that 
API. Efforts such as the low level memory access API [1], or attempts at 
defining a safer version of Unsafe.defineAnonymousInner class [2] go in 
this direction.

[1] - http://cr.openjdk.java.net/~mcimadamore/panama/memaccess.html
[2] - https://openjdk.java.net/jeps/181

Maurizio



More information about the panama-dev mailing list