pool

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 0 Imported by: 0

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 {
	New func() T
	// 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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL