leerho commented on code in PR #588:
URL: https://github.com/apache/datasketches-java/pull/588#discussion_r1721994661


##########
src/test/java/org/apache/datasketches/theta/UnionImplTest.java:
##########
@@ -191,21 +191,21 @@ public void checkMoveAndResizeOffHeap() {
     final int k = 1 << 12;
     final int u = 2 * k;
     final int bytes = Sketches.getMaxUpdateSketchBytes(k);
-    WritableMemory wmem = WritableMemory.allocateDirect(bytes / 2); //too 
small, forces new allocation on heap
-    WritableMemory wmem2 = WritableMemory.allocateDirect(bytes / 2);
+    WritableMemory wmem = WritableMemory.allocateDirect(bytes / 2); //not 
really used, except as a reference.
+    WritableMemory wmem2 = WritableMemory.allocateDirect(bytes / 2); //too 
small, forces new allocation on heap
     final UpdateSketch sketch = 
Sketches.updateSketchBuilder().setNominalEntries(k).build(wmem);
     assertTrue(sketch.isSameResource(wmem)); //also testing the isSameResource 
function
 
     final Union union = SetOperation.builder().buildUnion(wmem2);
     assertTrue(union.isSameResource(wmem2));
 
     for (int i = 0; i < u; i++) { union.update(i); }
-    assertFalse(union.isSameResource(wmem));
+    assertFalse(union.isSameResource(wmem)); //different Memories altogether
 
     final Union union2 = SetOperation.builder().buildUnion(); //on-heap union
     assertFalse(union2.isSameResource(wmem2));  //obviously not
-    wmem.close();
-    //note wmem2 has already been closed by the DefaultMemoryRequestServer
+    wmem.close(); //empty, but we must close it anyway.
+    //note wmem2 has already been closed by the DefaultMemoryRequestServer.

Review Comment:
   Fixed.



-- 
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]


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

Reply via email to