laurentgo commented on PR #43139: URL: https://github.com/apache/arrow/pull/43139#issuecomment-2231766529
> LGTM. I feel like we should investigate if we can refactor some of the memory manager code to avoid using reflection/unsafe and use MethodHandles instead now that we're off JDK 8 but it probably should be separate from this work. I actually did some of the work to use `MethodHandle`s in [my Java 21 change](https://github.com/apache/arrow/pull/43050) but that said using `MethodHandle`s doesn't bring that many benefits compared to using `sun.misc.Unsafe` directly (it would have been a requirement if using `--release 8` flag with javac because of https://bugs.openjdk.org/browse/JDK-8206937). What may bring some improvement is the use of [`VarHandle`](https://docs.oracle.com/javase%2F9%2Fdocs%2Fapi%2F%2F/java/lang/invoke/MethodHandles.html#byteBufferViewVarHandle-java.lang.Class-java.nio.ByteOrder-) to access a `ByteBuffer` efficiently and safely, or the new [Foreign Memory API](https://docs.oracle.com/en/java/javase/22/core/foreign-function-and-memory-api.html) introduced in Java 22. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
