hashtable

package
v1.5.3-rc5 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BytePageSize = 1 << 14 // 16KB
	BytePageMask = BytePageSize - 1

	Int64PageSize = BytePageSize >> 6
	Int64PageMask = Int64PageSize - 1
)
View Source
const (
	DefaultCapacity      int64 = 2 << 10
	DefaultMaxLoadFactor       = 0.5
)

Variables

Functions

This section is empty.

Types

type ByteArray

type ByteArray []byte

func NewByteArray

func NewByteArray() ByteArray

type ByteDoubleArray

type ByteDoubleArray []ByteArray

type Int64Array

type Int64Array []int64

func NewInt64Array

func NewInt64Array() Int64Array

type Int64DoubleArray

type Int64DoubleArray []Int64Array

type IntHashMap

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

func DefaultIntHashMap

func DefaultIntHashMap() *IntHashMap

func NewIntHashMap

func NewIntHashMap(capacity int64, maxLoadFactor float64, hashFunc func(int64) uint64) *IntHashMap

func (*IntHashMap) Clear

func (m *IntHashMap) Clear()

clear resets the IntHashMap to its initial empty state while preserving capacity and load factor for memory reuse. This allows efficient reuse of allocated memory instead of creating new IntHashMaps repeatedly.

Fields that are reset: - hashmap - keys: all key data cleared

func (*IntHashMap) Get

func (m *IntHashMap) Get(id uint64) int64

func (*IntHashMap) Set

func (m *IntHashMap) Set(key int64) uint64

type StringHashMap

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

func DefaultStringHashMap

func DefaultStringHashMap() *StringHashMap

func NewStringHashMap

func NewStringHashMap(capacity int64, maxLoadFactor float64, hashFunc func([]byte) uint64) *StringHashMap

func (*StringHashMap) Check added in v1.5.0

func (m *StringHashMap) Check(key []byte) (uint64, bool)

func (*StringHashMap) Clear

func (m *StringHashMap) Clear()

clear resets the StringHashMap to its initial empty state while preserving capacity and load factor for memory reuse. This allows efficient reuse of allocated memory instead of creating new StringHashMaps repeatedly.

Fields that are reset: - hashmap - keys: all key data cleared - startOffsets: all start offsets reset

func (*StringHashMap) Get

func (m *StringHashMap) Get(id uint64, dst []byte) []byte

func (*StringHashMap) Set

func (m *StringHashMap) Set(key []byte) uint64

Jump to

Keyboard shortcuts

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