mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-20 05:56:10 +05:00
optimize
This commit is contained in:
@@ -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()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user