mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 20:14:01 +03:00
FILE / ScuroNeko/mtg
stats/pools.go
Исходный файл и его история в репозитории.
19 lines
285 B
Go
19 lines
285 B
Go
package stats
|
|
|
|
import "sync"
|
|
|
|
var streamInfoPool = sync.Pool{
|
|
New: func() interface{} {
|
|
return streamInfo{}
|
|
},
|
|
}
|
|
|
|
func acquireStreamInfo() streamInfo {
|
|
return streamInfoPool.Get().(streamInfo)
|
|
}
|
|
|
|
func releaseStreamInfo(info streamInfo) {
|
|
info.Reset()
|
|
streamInfoPool.Put(info)
|
|
}
|