You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by le...@apache.org on 2021/03/29 19:09:53 UTC

[datasketches-memory] branch JDK13 updated: Cleanup 13

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

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


The following commit(s) were added to refs/heads/JDK13 by this push:
     new 1650c12  Cleanup 13
1650c12 is described below

commit 1650c12509bc19409bd32f9ead0da646d74b27de
Author: Lee Rhodes <le...@users.noreply.github.com>
AuthorDate: Mon Mar 29 12:05:21 2021 -0700

    Cleanup 13
---
 .../java/org/apache/datasketches/memory/AllocateDirectMap.java    | 2 +-
 src/main/java/org/apache/datasketches/memory/NioBits.java         | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/datasketches/memory/AllocateDirectMap.java b/src/main/java/org/apache/datasketches/memory/AllocateDirectMap.java
index d31c2a3..ff5ea6d 100644
--- a/src/main/java/org/apache/datasketches/memory/AllocateDirectMap.java
+++ b/src/main/java/org/apache/datasketches/memory/AllocateDirectMap.java
@@ -230,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 //TODO add getIsSync()
+    //final boolean isSync = true; //required as of JDK14, but it is more complex
     try {
       final long nativeBaseOffset = //JDK14 add isSync
         (long) FILE_CHANNEL_IMPL_MAP0_METHOD.invoke(fileChannel, mapMode, mapPosition, mapSize);
diff --git a/src/main/java/org/apache/datasketches/memory/NioBits.java b/src/main/java/org/apache/datasketches/memory/NioBits.java
index efa85b4..c683491 100644
--- a/src/main/java/org/apache/datasketches/memory/NioBits.java
+++ b/src/main/java/org/apache/datasketches/memory/NioBits.java
@@ -66,11 +66,11 @@ final class NioBits {
       NIO_BITS_CLASS = Class.forName("java.nio.Bits");
 
       NIO_BITS_RESERVE_MEMORY_METHOD = NIO_BITS_CLASS
-          .getDeclaredMethod("reserveMemory", long.class, int.class); //TODO JD16 requires (long, long)
+          .getDeclaredMethod("reserveMemory", long.class, int.class); //JD16 requires (long, long)
       NIO_BITS_RESERVE_MEMORY_METHOD.setAccessible(true);
 
       NIO_BITS_UNRESERVE_MEMORY_METHOD = NIO_BITS_CLASS
-          .getDeclaredMethod("unreserveMemory", long.class, int.class); //TODO JD16 requires (long, long)
+          .getDeclaredMethod("unreserveMemory", long.class, int.class); //JD16 requires (long, long)
       NIO_BITS_UNRESERVE_MEMORY_METHOD.setAccessible(true);
 
       //JDK 8-10: "count", "reservedMemory", "totalCapacity"
@@ -167,9 +167,9 @@ final class NioBits {
     while (capacity > 0) {
       final long chunk = Math.min(capacity, chunkSizeLimit);
       if (capacity == chunk) {
-        method.invoke(null, allocationSize, (int) capacity); //TODO JDK 16 remove cast to int
+        method.invoke(null, allocationSize, (int) capacity); //JDK 16 remove cast to int
       } else {
-        method.invoke(null, chunk, (int) chunk); //TODO JDK 16 remove cast to int
+        method.invoke(null, chunk, (int) chunk); //JDK 16 remove cast to int
       }
       capacity -= chunk;
       allocationSize -= chunk;

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org