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