This commit is contained in:
Chris Lu
2020-07-22 22:52:49 -07:00
parent 943fa4ea0c
commit 6839f96c0c
3 changed files with 2 additions and 2 deletions

View File

@@ -18,6 +18,7 @@ public class ByteBufferPool {
if (bufferSize < MIN_BUFFER_SIZE) {
bufferSize = MIN_BUFFER_SIZE;
}
LOG.debug("requested new buffer {}", bufferSize);
if (bufferList.isEmpty()) {
return ByteBuffer.allocate(bufferSize);
}
@@ -33,6 +34,7 @@ public class ByteBufferPool {
}
public static synchronized void release(ByteBuffer obj) {
obj.clear();
bufferList.add(0, obj);
}