LWJGL / lwjgl3

LWJGL is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL, Vulkan, bgfx), audio (OpenAL, Opus), parallel computing (OpenCL, CUDA) and XR (OpenVR, LibOVR, OpenXR) applications.

Home Page:https://www.lwjgl.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When will Unsafe be removed?

bowbahdoe opened this issue · comments

Question

I've been digging in to OpenAL and noticed some usages of sun.misc.Unsafe + a requires jdk.unsupported in the module-info.

Given that Unsafe will be removed at some point, what are the current plans for moving away from it? Are there particular upcoming APIs (like the foreign memory api? MultiReleaseMemCopy is where i found one of the usages.) that are being waited on?

Its only a duplicate if java.lang.foreign does hit all of the requirements needed to remove unsafe

LWJGL 3 supports Java 8 and that won't change before a new major version. Thus, just the release of the new FFI in Java 22 is not enough to replace Unsafe. Further, migrating to the new FFI is a significant undertaking and will probably not happen before value/primitive classes (or whatever they end up being called) are available.

Sure, Unsafe is being removed, but slowly. If this happens before value types are made available, this will be revisited, but that's unlikely. (I would actually be surprised if unsafe removed in the next four years.)