pool

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 1 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