restore v0.3.0
This commit is contained in:
21
entry/pool.go
Normal file
21
entry/pool.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package entry
|
||||
|
||||
import "sync"
|
||||
|
||||
// nolint: gochecknoglobals
|
||||
var pool = sync.Pool{
|
||||
New: func() interface{} {
|
||||
return New()
|
||||
},
|
||||
}
|
||||
|
||||
func Get() *Entry {
|
||||
e := pool.Get().(*Entry)
|
||||
e.Reset()
|
||||
|
||||
return e
|
||||
}
|
||||
|
||||
func Put(e *Entry) {
|
||||
pool.Put(e)
|
||||
}
|
||||
Reference in New Issue
Block a user