mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-23 12:16:38 +00:00
21 lines
489 B
Go
21 lines
489 B
Go
|
package util
|
||
|
|
||
|
import (
|
||
|
"codeberg.org/gruf/go-fastpath"
|
||
|
"codeberg.org/gruf/go-pools"
|
||
|
)
|
||
|
|
||
|
// pathBuilderPool is the global fastpath.Builder pool
|
||
|
var pathBuilderPool = pools.NewPathBuilderPool(512)
|
||
|
|
||
|
// GetPathBuilder fetches a fastpath.Builder object from the pool
|
||
|
func GetPathBuilder() *fastpath.Builder {
|
||
|
return pathBuilderPool.Get()
|
||
|
}
|
||
|
|
||
|
// PutPathBuilder places supplied fastpath.Builder back in the pool
|
||
|
func PutPathBuilder(pb *fastpath.Builder) {
|
||
|
pb.Reset()
|
||
|
pathBuilderPool.Put(pb)
|
||
|
}
|