M. Efe Çetin 937713e41e
feature: bind support for render (#1754)
* Bind support for Render.

* update

* fix tests

* split Pass-locals-to-views & Bind from Render

* update comments.

* add benchs.

* Update ctx.go

Co-authored-by: hi019 <65871571+hi019@users.noreply.github.com>

* Update ctx.go

* optimize

* switch dictpool.

*  feature: bind support for render
- improve performance

*  feature: bind support for render
- improve performance

Co-authored-by: hi019 <65871571+hi019@users.noreply.github.com>
Co-authored-by: wernerr <rene.werner@verivox.com>
Co-authored-by: wernerr <rene@gofiber.io>
2022-02-12 22:52:24 +01:00

21 lines
328 B
Go

package dictpool
import "sync"
var defaultPool = sync.Pool{
New: func() interface{} {
return new(Dict)
},
}
// AcquireDict acquire new dict.
func AcquireDict() *Dict {
return defaultPool.Get().(*Dict) // nolint:forcetypeassert
}
// ReleaseDict release dict.
func ReleaseDict(d *Dict) {
d.Reset()
defaultPool.Put(d)
}