slowtable

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: MIT Imports: 6 Imported by: 0

README

slowtable

Slow and non-optimized hash table

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Table

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

func NewTable

func NewTable(hash func([]byte) uint64, keysize uint64) *Table

NewTable : Create a new table hash : xxHash64 (default) if hash == nil keysize : The number of keys in the table (recommended: 65536)

func (*Table) Clear

func (t *Table) Clear()

Clear : Clear the table Note: This function drops all the items in the table (GC overhead) No Pooling

func (*Table) CompareAndSwap added in v1.2.0

func (t *Table) CompareAndSwap(key []byte, old, new unsafe.Pointer) bool

func (*Table) Delete

func (t *Table) Delete(key []byte)

Delete : Delete the item from the table Thread safe

func (*Table) DeleteS added in v1.1.0

func (t *Table) DeleteS(key string)

DeleteS : Delete the item from the table Thread safe

func (*Table) Exists

func (t *Table) Exists(key []byte) bool

func (*Table) Get

func (t *Table) Get(key []byte) (unsafe.Pointer, bool)

Get : Get the value for the given key Thread safe

func (*Table) GetS added in v1.1.0

func (t *Table) GetS(key string) (unsafe.Pointer, bool)

GetS : Get the value for the given key(String) Thread safe

func (*Table) PoolPreload

func (t *Table) PoolPreload()

func (*Table) Set

func (t *Table) Set(key []byte, val unsafe.Pointer)

Set : Set the value for the given key Thread safe

func (*Table) SetS added in v1.1.0

func (t *Table) SetS(key string, val unsafe.Pointer)

SetS : Set the value for the given key(String) Thread safe

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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