| 123456789101112131415161718 |
- 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)
- }
|