mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 11:54:01 +03:00
Rework stats
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package stats
|
||||
|
||||
import "sync"
|
||||
|
||||
var streamInfoPool = sync.Pool{
|
||||
New: func() interface{} {
|
||||
return &streamInfo{
|
||||
tags: map[string]string{},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
func acquireStreamInfo() *streamInfo {
|
||||
return streamInfoPool.Get().(*streamInfo)
|
||||
}
|
||||
|
||||
func releaseStreamInfo(info *streamInfo) {
|
||||
info.Reset()
|
||||
streamInfoPool.Put(info)
|
||||
}
|
||||
Reference in New Issue
Block a user