slab

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MPL-2.0, ISC Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Slab

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

Slab is an implementation of the internal registry free list. A zero-value instance is a valid instance. A slab is safe to use concurrently.

func (*Slab) Delete

func (s *Slab) Delete(i uintptr)

Delete removes the entry at the given index.

func (*Slab) Get

func (s *Slab) Get(i uintptr) interface{}

Get gets the entry at the given index.

func (*Slab) Grow

func (s *Slab) Grow(n int)

Grow grows the slab to the given capacity.

func (*Slab) Pop

func (s *Slab) Pop(i uintptr) interface{}

Pop removes the entry at the given index and returns the old value.

func (*Slab) Put

func (s *Slab) Put(entry interface{}, once bool) uintptr

Put stores the entry inside the slab. If once is true, then when the entry is retrieved using Get, it will also be wiped off the list.

Jump to

Keyboard shortcuts

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