gianm commented on code in PR #12521:
URL: https://github.com/apache/druid/pull/12521#discussion_r873971511


##########
core/src/main/java/org/apache/druid/java/util/common/ByteBufferUtils.java:
##########
@@ -138,6 +144,45 @@ private static MethodHandle 
unmapJava9(MethodHandles.Lookup lookup) throws Refle
     return unmapper.bindTo(UnsafeUtils.theUnsafe());
   }
 
+  /**
+   * Same as {@link ByteBuffer#allocateDirect(int)}, but returns a closeable 
{@link ResourceHolder} that
+   * frees the buffer upon close.
+   */
+  public static ResourceHolder<ByteBuffer> allocateDirect(final int size)

Review Comment:
   I thought about that, but decided against it, since the production code is 
fine and I didn't want to fix what wasn't broken.



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