code: private void recycleBuffer(MemorySegment buffer) {
  		synchronized (this.buffers) {
  			if (this.isDestroyed) {
  				this.globalBufferPool.returnBuffer(buffer);
  				this.numRequestedBuffers--;
  			} else {
  				// if the number of designated buffers changed in the meantime, make sure
  				// to return the buffer to the global buffer pool
  				if (this.numRequestedBuffers > this.numDesignatedBuffers) {
  					this.globalBufferPool.returnBuffer(buffer);
  					this.numRequestedBuffers--;
  
  				} else if (!this.listeners.isEmpty()) {
  					Buffer availableBuffer = new Buffer(buffer, buffer.size(), this.recycler);
  					try {
  						this.listeners.poll().bufferAvailable(availableBuffer);
  					} catch (Exception e) {
  						this.buffers.add(buffer);
  						this.buffers.notify();
  					}
  
  				} else {
  					this.buffers.add(buffer);
  					this.buffers.notify();
  				}
  			}
  		}
  	}
docs: Returns a buffer to the buffer pool and notifies listeners about the availability of a new buffer.
  
  @param buffer buffer to return to the buffer pool