internal

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2024 License: BSD-3-Clause, GooglePatentClause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pad4

func Pad4(n int) int

Pad4 aligns a length to 4 bytes.

func PopCount

func PopCount(mask int) (n int)

PopCount counts the number of bits set in a value list mask.

Types

type Map

type Map[Key comparable, Value any] struct {
	// contains filtered or unexported fields
}

Map provides a concurrency safe wrapper round a map[Key]Value optimized heavily for read speeds. Writes will reallocate the existing contents of the map on each ocurrence.

func (*Map[Key, Value]) Add added in v1.1.2

func (m *Map[Key, Value]) Add(key Key, value Value) (ok bool)

func (*Map[Key, Value]) Get

func (m *Map[Key, Value]) Get(key Key) (v Value, ok bool)

type SmallPtrMap added in v1.1.1

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

SmallPtrMap is an array of raw (unsafe) pointers of length equal to the number of possible values contained in a uint8. All read / write operations are performed atomically.

func (*SmallPtrMap) Get added in v1.1.1

func (m *SmallPtrMap) Get(n uint8) unsafe.Pointer

func (*SmallPtrMap) Set added in v1.1.1

func (m *SmallPtrMap) Set(n uint8, p unsafe.Pointer) bool

Jump to

Keyboard shortcuts

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