package
Version:
v2.9.6
Opens a new window with list of versions in this module.
Published: Apr 13, 2024
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package mem implements the memory utility.
type Pool[T any] struct {
}
Pool represents memory pool of T.
func NewPool[T any](f func() *T) Pool[T]
NewPool returns a memory pool of T.
func (p Pool[T]) Get() *T
Get gets instance of T from the memory pool.
func (p Pool[T]) Put(x *T)
Put puts the instance to the memory pool.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.