FILE / ScuroNeko/mtg

stats/pools.go

Исходный файл и его история в репозитории.
FILE 8566cede74a68c3b82b5ee18989db4d4f8c3d242
Files
mtg/stats/pools.go
T

21 lines
326 B
Go

package stats
import "sync"
var streamInfoPool = sync.Pool{
New: func() interface{} {
return &streamInfo{
tags: make(map[string]string),
}
},
}
func acquireStreamInfo() *streamInfo {
return streamInfoPool.Get().(*streamInfo)
}
func releaseStreamInfo(info *streamInfo) {
info.Reset()
streamInfoPool.Put(info)
}