This commit is contained in:
yourok
2019-10-16 20:50:16 +03:00
parent 8c2678fbf2
commit 5cb2cf836a

View File

@@ -3,8 +3,6 @@ package memcache
import (
"fmt"
"sync"
"server/utils"
)
type buffer struct {
@@ -65,7 +63,6 @@ func (b *BufferPool) GetBuffer(p *Piece) (buff []byte, index int) {
func (b *BufferPool) ReleaseBuffer(index int) {
if index == -1 {
utils.FreeOSMem()
return
}
b.mu.Lock()
@@ -75,9 +72,6 @@ func (b *BufferPool) ReleaseBuffer(index int) {
buff.used = false
buff.pieceId = -1
b.frees++
//fmt.Println("Release buffer:", index, b.frees)
} else {
utils.FreeOSMem()
}
}