mem

package
v2.9.6 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package mem implements the memory utility.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

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

Pool represents memory pool of T.

func NewPool

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

NewPool returns a memory pool of T.

func (Pool[T]) Get

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

Get gets instance of T from the memory pool.

func (Pool[T]) Put

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

Put puts the instance to the memory pool.

Jump to

Keyboard shortcuts

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