Refactor bufpool methods
This commit is contained in:
@@ -15,7 +15,7 @@ func NewBufferPoolManager() *BufferPoolManager {
|
||||
}
|
||||
}
|
||||
|
||||
func (bpm *BufferPoolManager) GetBuffer(size uint) *[]uint8 {
|
||||
func (bpm *BufferPoolManager) Get(size uint) *[]uint8 {
|
||||
bpm.mu.RLock()
|
||||
pool, exists := bpm.pools[size]
|
||||
bpm.mu.RUnlock()
|
||||
@@ -39,7 +39,7 @@ func (bpm *BufferPoolManager) GetBuffer(size uint) *[]uint8 {
|
||||
return pool.Get().(*[]uint8)
|
||||
}
|
||||
|
||||
func (bpm *BufferPoolManager) PutBuffer(buf *[]uint8) {
|
||||
func (bpm *BufferPoolManager) Put(buf *[]uint8) {
|
||||
size := uint(len(*buf))
|
||||
bpm.mu.RLock()
|
||||
pool, exists := bpm.pools[size]
|
||||
|
||||
Reference in New Issue
Block a user