slots

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NextClearStrategy

type NextClearStrategy interface {
	NextClear(set *bitset.BitSet) (int, bool)
}

type Option

type Option interface {
	ApplyTo(opts *Options)
}

type Options

type Options struct {
	Offset int
}

func (*Options) ApplyOptions

func (o *Options) ApplyOptions(opts []Option) *Options

type Slots

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

func New

func New(len int, opts ...Option) *Slots

func (*Slots) Allocate

func (s *Slots) Allocate(index int) (bool, error)

func (*Slots) AllocateNext

func (s *Slots) AllocateNext() (int, bool, error)

func (*Slots) Free

func (s *Slots) Free() int

func (*Slots) Has

func (s *Slots) Has(index int) bool

func (*Slots) Iterate

func (s *Slots) Iterate(f func(int) bool) bool

func (*Slots) Release

func (s *Slots) Release(index int) error

Release releases an index. Releasing an unallocated or out-of-range index is considered a no-op.

func (*Slots) Reset

func (s *Slots) Reset()

type WithOffset

type WithOffset int

func (WithOffset) ApplyTo

func (o WithOffset) ApplyTo(opts *Options)

Jump to

Keyboard shortcuts

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