mass

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 0 Imported by: 3

README

mass

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mass

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

Mass maintains a pool of objects to avoid excessive number of heap allocations.

func New

func New[T any](capacity uint64) *Mass[T]

New returns new pool.

func (*Mass[T]) New

func (m *Mass[T]) New() *T

New returns new object from the pool.

func (*Mass[T]) NewSlice added in v0.2.0

func (m *Mass[T]) NewSlice(n uint64) []T

NewSlice returns new slice of objects from the pool.

Jump to

Keyboard shortcuts

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