This is an automated email from the ASF dual-hosted git repository.

leerho pushed a commit to branch java-11-experimental
in repository https://gitbox.apache.org/repos/asf/datasketches-memory.git


The following commit(s) were added to refs/heads/java-11-experimental by this 
push:
     new e269dca  Add comments
e269dca is described below

commit e269dca62548dca50b7c55f538fa30f09d0ceafe
Author: Lee Rhodes <[email protected]>
AuthorDate: Mon Mar 29 12:50:22 2021 -0700

    Add comments
---
 src/main/java/org/apache/datasketches/memory/AllocateDirectMap.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/src/main/java/org/apache/datasketches/memory/AllocateDirectMap.java 
b/src/main/java/org/apache/datasketches/memory/AllocateDirectMap.java
index 168d2ef..2dd0630 100644
--- a/src/main/java/org/apache/datasketches/memory/AllocateDirectMap.java
+++ b/src/main/java/org/apache/datasketches/memory/AllocateDirectMap.java
@@ -67,7 +67,7 @@ class AllocateDirectMap implements Map {
   static final Method MAPPED_BYTE_BUFFER_FORCE0_METHOD;
 
   static {
-    try {
+    try { //The FileChannelImpl methods map0 and unmap0 still exist in 16
       FILE_CHANNEL_IMPL_MAP0_METHOD = FileChannelImpl.class
           .getDeclaredMethod("map0", int.class, long.class, long.class); 
//JDK14 add boolean.class
       FILE_CHANNEL_IMPL_MAP0_METHOD.setAccessible(true);
@@ -76,6 +76,8 @@ class AllocateDirectMap implements Map {
           .getDeclaredMethod("unmap0", long.class, long.class); //OK through 
jDK16
       FILE_CHANNEL_IMPL_UNMAP0_METHOD.setAccessible(true);
 
+      
+      //The MappedByteBuffer methods load0, isLoaded0 and force0 are removed 
in 15
       MAPPED_BYTE_BUFFER_LOAD0_METHOD = MappedByteBuffer.class
           .getDeclaredMethod("load0", long.class, long.class); //JDK15 removed
       MAPPED_BYTE_BUFFER_LOAD0_METHOD.setAccessible(true);
@@ -228,7 +230,7 @@ class AllocateDirectMap implements Map {
     final long mapPosition = position - pagePosition;
     final long mapSize = lengthBytes + pagePosition;
     final int mapMode = resourceReadOnly ? MAP_RO : MAP_RW;
-    //final boolean isSync = true; //required as of JDK14
+    //final boolean isSync = true; //required as of JDK14, but it is more 
complex
     try {
       final long nativeBaseOffset =
           (long) FILE_CHANNEL_IMPL_MAP0_METHOD.invoke(fileChannel, mapMode, 
mapPosition, mapSize); //JDK14 add isSync

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to