Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ObjectPool ¶
type ObjectPool[T any] struct { // contains filtered or unexported fields }
ObjectPool is a generic analogue of sync.Pool, except it does not provide thread-safety. Concurrent access may lead to UB
func NewObjectPool ¶
func NewObjectPool[T any](queueSize int) ObjectPool[T]
func (*ObjectPool[T]) Acquire ¶
func (o *ObjectPool[T]) Acquire() (obj T)
func (*ObjectPool[T]) Release ¶
func (o *ObjectPool[T]) Release(obj T)
Click to show internal directories.
Click to hide internal directories.