leerho commented on code in PR #241:
URL:
https://github.com/apache/datasketches-memory/pull/241#discussion_r1847511881
##########
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 ≥ 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.
Review Comment:
Good Catch!
--
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]