rangeindex

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unpack

func Unpack(v uint64) (uint32, uint32)

Unpack extracts location and its value from one element of query result.

Types

type RangeIndex

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

RangeIndex stores entries as: high 32 bits: location low 32 bits: value

func NewRangeIndex

func NewRangeIndex() *RangeIndex

NewRangeIndex retrieves an object from the pool and resets it.

func (*RangeIndex) Add

func (ri *RangeIndex) Add(loc, value uint32)

Add inserts a (loc, value) pair. loc and value are both uint32.

func (*RangeIndex) Query

func (ri *RangeIndex) Query(left, right uint32) []uint64

Query returns all entries whose loc is within the given range. Attention: the length of result might be 0. Note that: each returned slice element contain both location and value. You can get the location by v >> 32, and value v & 4294967295

func (*RangeIndex) Release

func (ri *RangeIndex) Release()

Release returns the object back to the pool. Large backing arrays are dropped to avoid memory bloat.

Jump to

Keyboard shortcuts

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