diff options
Diffstat (limited to 'vendor/git.iim.gay/grufwub/fastpath/pool.go')
-rw-r--r-- | vendor/git.iim.gay/grufwub/fastpath/pool.go | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/vendor/git.iim.gay/grufwub/fastpath/pool.go b/vendor/git.iim.gay/grufwub/fastpath/pool.go deleted file mode 100644 index 047485476..000000000 --- a/vendor/git.iim.gay/grufwub/fastpath/pool.go +++ /dev/null @@ -1,32 +0,0 @@ -package fastpath - -import "sync" - -// 1/8 max unix path length -const defaultBufSize = 512 - -var ( - builderPool sync.Pool - once = sync.Once{} -) - -func pool() *sync.Pool { - once.Do(func() { - builderPool = sync.Pool{ - New: func() interface{} { - builder := NewBuilder(make([]byte, defaultBufSize)) - return &builder - }, - } - }) - return &builderPool -} - -func AcquireBuilder() *Builder { - return pool().Get().(*Builder) -} - -func ReleaseBuilder(b *Builder) { - b.Reset() - pool().Put(b) -} |