mempool

package
v0.33.30 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Allocator

type Allocator[T any] interface {
	New() T
	Reset(m T)
}

type CollectionPool

type CollectionPool[T any] struct {
	// contains filtered or unexported fields
}

func NewCollectionPool

func NewCollectionPool[T any](alloc Allocator[T]) *CollectionPool[T]

func (*CollectionPool[T]) Get

func (p *CollectionPool[T]) Get() T

func (CollectionPool[T]) GetSlice

func (p CollectionPool[T]) GetSlice() *[]T

func (*CollectionPool[T]) Put

func (p *CollectionPool[T]) Put(t T)

func (*CollectionPool[T]) PutSlice

func (p *CollectionPool[T]) PutSlice(s *[]T)

type Pool

type Pool[T any] struct {
	sync.Pool
}

func NewPool

func NewPool[T any](newF func() T) *Pool[T]

func NewSlicePool

func NewSlicePool[T any](capacity int) *Pool[*[]T]

func (*Pool[T]) Get

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

func (*Pool[T]) Put

func (p *Pool[T]) Put(x T)

type RelationAllocator

type RelationAllocator struct {
	// contains filtered or unexported fields
}

func NewRelationAllocator

func NewRelationAllocator() *RelationAllocator

func (*RelationAllocator) New

func (*RelationAllocator) Reset

func (ra *RelationAllocator) Reset(rel *dsc.RelationIdentifier)

type RelationsPool

type RelationsPool = CollectionPool[*dsc.RelationIdentifier]

func NewRelationsPool

func NewRelationsPool() *RelationsPool

Jump to

Keyboard shortcuts

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