pool

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: BSD-3-Clause Imports: 1 Imported by: 11

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[*Slice[T]]

func (*Pool[T]) Get

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

func (*Pool[T]) Put

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

type Slice added in v0.7.0

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

func (*Slice[T]) Reset added in v0.7.0

func (v *Slice[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