hash

package
v0.0.0-...-2e61c1d Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Copyright 2014 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

View Source
const (
	DefaultLoadFactor = 4 // float64(mapSizeNow)/float64(bucketSizeNow)  > DefaultLoadFactor的时候,扩展桶数组
)
View Source
const PtrSize = 4 << (^uintptr(0) >> 63) // unsafe.Sizeof(uintptr(0)) but an ideal const
View Source
const SentinelOfSentinelHash = math.MaxInt64

Variables

This section is empty.

Functions

This section is empty.

Types

type BucketList

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

func NewBucketList

func NewBucketList() *BucketList

func (*BucketList) Contains

func (bl *BucketList) Contains(keyHash int64, key interface{}) bool

func (*BucketList) Find

func (bl *BucketList) Find(keyHash int64, key interface{}) (interface{}, bool)

func (*BucketList) Get

func (bl *BucketList) Get(keyHash int64, key interface{}) interface{}

func (*BucketList) Put

func (bl *BucketList) Put(keyHash int64, key interface{}, value interface{})

notes: Put nil value is not equivalent as Remove

func (*BucketList) Remove

func (bl *BucketList) Remove(keyHash int64, key interface{}) bool

type FixedBucketLockFreeMap

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

func NewFixedBucketLockFreeMap

func NewFixedBucketLockFreeMap(bucketCap int, keyType reflect.Kind) *FixedBucketLockFreeMap

func (*FixedBucketLockFreeMap) Contains

func (lfMap *FixedBucketLockFreeMap) Contains(key interface{}) bool

func (*FixedBucketLockFreeMap) Find

func (lfMap *FixedBucketLockFreeMap) Find(key interface{}) (interface{}, bool)

func (*FixedBucketLockFreeMap) Get

func (lfMap *FixedBucketLockFreeMap) Get(key interface{}) interface{}

func (*FixedBucketLockFreeMap) Put

func (lfMap *FixedBucketLockFreeMap) Put(key interface{}, value interface{}) bool

func (*FixedBucketLockFreeMap) Remove

func (lfMap *FixedBucketLockFreeMap) Remove(key interface{}) bool

type LockFreeMap

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

func NewLockFreeMap

func NewLockFreeMap(keyType reflect.Kind) *LockFreeMap

func (*LockFreeMap) Contains

func (lfMap *LockFreeMap) Contains(key interface{}) bool

func (*LockFreeMap) Find

func (lfMap *LockFreeMap) Find(key interface{}) (interface{}, bool)

func (*LockFreeMap) Get

func (lfMap *LockFreeMap) Get(key interface{}) interface{}

func (*LockFreeMap) Iter

func (lfMap *LockFreeMap) Iter() MapIterator

func (*LockFreeMap) Put

func (lfMap *LockFreeMap) Put(key interface{}, value interface{}) bool

func (*LockFreeMap) Remove

func (lfMap *LockFreeMap) Remove(key interface{}) bool

type MapIterator

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

func (*MapIterator) Next

func (iter *MapIterator) Next() (bool, interface{}, interface{})

Jump to

Keyboard shortcuts

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