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