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


##########
src/main/java/org/apache/datasketches/memory/WritableMemory.java:
##########
@@ -194,12 +193,13 @@ static WritableMemory allocateDirect(
    * @return WritableMemory

Review Comment:
   Add warning as above, also ResourceScope  needs to be replaced at about L186
   



##########
src/main/java/org/apache/datasketches/memory/MemoryRequestServer.java:
##########
@@ -42,24 +42,24 @@ public interface MemoryRequestServer {
   default WritableMemory request(
       WritableMemory currentWritableMemory,
       long newCapacityBytes) {
-    return request(currentWritableMemory, newCapacityBytes, 
ResourceScope.newConfinedScope());
+
+    return request(currentWritableMemory, newCapacityBytes, 
Arena.ofConfined());
   }
 
   /**
    * Request new WritableMemory with the given newCapacityBytes. The current 
Writable Memory can be used to
    * determine the byte order of the returned WritableMemory and other 
properties.
    * @param currentWritableMemory the current writableMemory of the client. It 
must be non-null.
    * @param newCapacityBytes The capacity being requested. It must be > the 
capacity of the currentWritableMemory.
-   * @param scope the ResourceScope to be used for the newly allocated memory.
-   * It must be non-null.
+   * @param arena the Arena to be used for the newly allocated memory. It must 
be non-null.
    * Typically use <i>ResourceScope.newConfinedScope()</i>.
    * Warning: specifying a <i>newSharedScope()</i> is not supported.

Review Comment:
   Add warning as above. Also replace _ResourceScope_



##########
src/main/java/org/apache/datasketches/memory/WritableMemory.java:
##########
@@ -194,12 +193,13 @@ static WritableMemory allocateDirect(
    * @return WritableMemory
    */
   static WritableMemory allocateDirect(
+      Arena arena,
       long capacityBytes,
       long alignmentBytes,
-      ResourceScope scope,
+      Scope scope,

Review Comment:
   I don't think we need and Arena and a MemorySegment.Scope.



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