A DESCRIPTION OF THE PROBLEM :
I am working with java.nio.ByteBuffer in performance sensitive code. Upon inspecting the source code for specialized buffers that wrap ByteBuffer (i.e. ByteBufferAsIntBufferB, etc) I have noticed the fact that their putX methods is calling SCOPED_MEMORY_ACCESS.putXUnaligned, whereas my first instinct would be that they should be calling SCOPED_MEMORY_ACCESS.putX since the position() is always aligned for these buffers.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
This is the template from which the wrapping buffer classes are generated: https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/nio/ByteBufferAs-X-Buffer.java.template.
In the template the "put" method always delegates to "SCOPED_MEMORY_ACCESS.put$Memtype$Unaligned"
I am working with java.nio.ByteBuffer in performance sensitive code. Upon inspecting the source code for specialized buffers that wrap ByteBuffer (i.e. ByteBufferAsIntBufferB, etc) I have noticed the fact that their putX methods is calling SCOPED_MEMORY_ACCESS.putXUnaligned, whereas my first instinct would be that they should be calling SCOPED_MEMORY_ACCESS.putX since the position() is always aligned for these buffers.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
This is the template from which the wrapping buffer classes are generated: https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/nio/ByteBufferAs-X-Buffer.java.template.
In the template the "put" method always delegates to "SCOPED_MEMORY_ACCESS.put$Memtype$Unaligned"
- relates to
-
JDK-8282191 Implementation of Foreign Function & Memory API (Preview)
-
- Resolved
-