Skip to content

Commit

Permalink
remove BufferLeasePool#offer(BufferLease bufferLease); (#141)
Browse files Browse the repository at this point in the history
closes #134
  • Loading branch information
kortemik authored Apr 17, 2024
1 parent 8d56264 commit d0df8e5
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,6 @@ public List<BufferLease> take(long size) {

}

// FIXME remove this, use BufferLease.removeRef() instead directly.
public void offer(BufferLease bufferLease) {
bufferLease.removeRef();
}

/**
* return {@link BufferContainer} into the pool.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ private void activateBuffers(List<BufferLease> bufferLeases) {
}
else {
// unused buffer, releasing back to pool
bufferLeasePool.offer(bufferLease);
bufferLease.removeRef();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void close() {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("releasing id <{}> with refs <{}>", bufferLease.id(), bufferLease.refs());
}
bufferLeasePool.offer(bufferLease);
bufferLease.removeRef();
}
relpFrame.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void testPool() {

Assertions.assertEquals(1, lease.refs()); // initial ref must be still in

bufferLeasePool.offer(lease); // removes initial ref
lease.removeRef(); // removes initial ref

Assertions.assertEquals(1, bufferLeasePool.estimatedSize()); // the one offered must be there

Expand Down

0 comments on commit d0df8e5

Please sign in to comment.