pool

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: BSD-3-Clause Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

type Pool[T TPool] struct {
	// contains filtered or unexported fields
}

func New

func New[T TPool](callNew func() T) *Pool[T]

func NewSlicePool

func NewSlicePool[T any](l, c int) *Pool[*SlicePool[T]]

func (*Pool[T]) Get

func (v *Pool[T]) Get() T

func (*Pool[T]) Put

func (v *Pool[T]) Put(t T)

type SlicePool

type SlicePool[T any] struct {
	B []T
}

func (*SlicePool[T]) Reset

func (v *SlicePool[T]) Reset()

type TPool

type TPool interface {
	Reset()
}

Jump to

Keyboard shortcuts

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