NO-JIRA releaseBufferMemory just in case

This is just to make releaseBuffer to have the same semantic when no pool is used.

This has no effect on how the broker behaves as we always have it pooled.
This commit is contained in:
Clebert Suconic 2022-12-08 13:25:40 -05:00 committed by clebertsuconic
parent bfb33c7a26
commit 44cec5976c
1 changed files with 5 additions and 1 deletions

View File

@ -134,7 +134,9 @@ public class NIOSequentialFileFactory extends AbstractSequentialFileFactory {
@Override
public void releaseDirectBuffer(ByteBuffer buffer) {
PlatformDependent.freeDirectBuffer(buffer);
if (buffer.isDirect()) {
PlatformDependent.freeDirectBuffer(buffer);
}
}
@Override
@ -155,6 +157,8 @@ public class NIOSequentialFileFactory extends AbstractSequentialFileFactory {
public void releaseBuffer(ByteBuffer buffer) {
if (this.bufferPooling) {
bytesPool.release(buffer);
} else {
releaseDirectBuffer(buffer);
}
}