leerho commented on code in PR #241:
URL: 
https://github.com/apache/datasketches-memory/pull/241#discussion_r1847519015


##########
src/main/java/org/apache/datasketches/memory/WritableMemory.java:
##########
@@ -83,54 +83,50 @@ static WritableMemory writableWrap(
    * required by the implementation.
    */
   static WritableMemory writableMap(File file) throws IOException {
-    return writableMap(file, 0, file.length(), ByteOrder.nativeOrder());
+    return writableMap(Arena.ofConfined(), file, 0, file.length(), 
ByteOrder.nativeOrder());
   }
 
   /**
-   * Maps the specified portion of the given file into Memory for write 
operations.
-   * @param file the given file to map. It must be non-null and writable.
+   * Maps the specified portion of the given file into Memory for write 
operations with a ResourceScope.
+   * @param file the given file to map. It must be non-null with a 
non-negative length and writable.
    * @param fileOffsetBytes the position in the given file in bytes. It must 
not be negative.
-   * @param capacityBytes the size of the mapped Memory.
-   * @param byteOrder the given <i>ByteOrder</i>. It must be non-null.
-   * @return a file-mapped WritableMemory.
-   * @throws IllegalArgumentException if file is not readable or not writable.
-   * @throws IOException if the specified path does not point to an existing 
file, or if some other I/O error occurs.
-   * @throws SecurityException If a security manager is installed and it 
denies an unspecified permission
+   * @param capacityBytes the size of the mapped Memory. It must be &ge; 0.
+   * @param byteOrder the byte order to be used.  It must be non-null.
+   * @return mapped WritableMemory.
+   * @throws IllegalArgumentException -- if file is not readable or writable.
+   * @throws IllegalArgumentException -- if file is not writable.
+   * @throws IOException - if the specified path does not point to an existing 
file, or if some other I/O error occurs.
+   * @throws SecurityException - If a security manager is installed and it 
denies an unspecified permission
    * required by the implementation.
    */
   static WritableMemory writableMap(
       File file,
       long fileOffsetBytes,
       long capacityBytes,
       ByteOrder byteOrder) throws IOException {
-    final ResourceScope scope = ResourceScope.newConfinedScope();
-    return WritableMemoryImpl.wrapMap(file, fileOffsetBytes, capacityBytes, 
scope, false, byteOrder);
+    return WritableMemoryImpl.wrapMap(Arena.ofConfined(), file, 
fileOffsetBytes, capacityBytes, false, byteOrder);
   }
 
   /**
-   * Maps the specified portion of the given file into Memory for write 
operations with a ResourceScope.
-   * @param file the given file to map. It must be non-null with a 
non-negative length and writable.
+   * Maps the specified portion of the given file into Memory for write 
operations.
+   * @param arena the given arena to map. It must be non-null.
+   * @param file the given file to map. It must be non-null and writable.
    * @param fileOffsetBytes the position in the given file in bytes. It must 
not be negative.
-   * @param capacityBytes the size of the mapped Memory. It must be &ge; 0.
-   * @param scope the given ResourceScope.
-   * It must be non-null.
-   * Typically use <i>ResourceScope.newConfinedScope()</i>.
-   * Warning: specifying a <i>newSharedScope()</i> is not supported.

Review Comment:
   Similar warning as above.



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