Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,6 @@ private void passBufferToCallback(ByteBuf visitBuffer, int visitIndex, int visit
handleArray(visitBuffer.array(), visitBuffer.arrayOffset() + visitIndex, visitLength);
} else if (visitBuffer.hasMemoryAddress() && callback.acceptsMemoryAddress(callbackContext)) {
callback.visitBuffer(callbackContext, visitBuffer, visitIndex, visitLength);
} else if (callback.acceptsMemoryAddress(callbackContext) && visitBuffer.isDirect()
&& visitBuffer.alloc().isDirectBufferPooled()) {
// read-only buffers need to be copied before they can be directly accessed
ByteBuf copyBuffer = visitBuffer.copy(visitIndex, visitLength);
callback.visitBuffer(callbackContext, copyBuffer, 0, visitLength);
copyBuffer.release();
} else {
// fallback to reading the visited buffer into the copy buffer in a loop
byte[] copyBuffer = TL_COPY_BUFFER.get();
Expand Down