Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When will Unsafe be removed? #962

Open
bowbahdoe opened this issue Mar 3, 2024 · 3 comments
Open

When will Unsafe be removed? #962

bowbahdoe opened this issue Mar 3, 2024 · 3 comments

Comments

@bowbahdoe
Copy link

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?

@ws909
Copy link

ws909 commented Mar 3, 2024

@bowbahdoe
Copy link
Author

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

@TheMrMilchmann
Copy link
Contributor

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants