hashmap

package module
v0.0.0-...-ac5b162 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Pick08 = [...]byte{
	0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
	0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
}
View Source
var SpaceBytes = [8][16]byte{
	fillBytes16('\t'),
	fillBytes16('\n'),
	fillBytes16('\v'),
	fillBytes16('\f'),
	fillBytes16('\r'),
	fillBytes16(' '),
	fillBytes16(0x85),
	fillBytes16(0xA0),
}
View Source
var SpaceQ = [8]byte{0x85, 0xA0, '\t', '\n', '\v', '\f', '\r', ' '}

asm 中读入 X0 寄存器

Functions

func Ctz64

func Ctz64(x uint64) int

Ctz64 counts trailing (low-order) zeroes, and if all are zero, then 64.

func FirstBitIdx

func FirstBitIdx(in int64) int

func Hash

func Hash(bs, cs []byte) int

func Hashx

func Hashx(bs []byte, cs []N) int

func InSpaceQ

func InSpaceQ(b byte) bool

在 asm 中实现

func IndexByte

func IndexByte(bs []byte, c byte) int

func IndexBytes

func IndexBytes(bs []byte, cs []byte) int

func IndexBytes1

func IndexBytes1(bs []byte, cs []byte) int

func IndexBytes2

func IndexBytes2(bs []byte, cs []byte) int

func Len64

func Len64(x uint64) (n int)

Len64 returns the minimum number of bits required to represent x; the result is 0 for x == 0.

func Len64_2

func Len64_2(x uint64) (n int)

func PrintKeys

func PrintKeys(bsList []string)

func PrintMask

func PrintMask(allMask string)

func Test1

func Test1(x, y int) (a, b int)

func Test2

func Test2(a int, xs []byte) (n int)

Types

type GoEface

type GoEface struct {
	Type  *GoType
	Value unsafe.Pointer
}

func UnpackEface

func UnpackEface(v interface{}) GoEface

type GoIface

type GoIface struct {
	Itab  *GoItab
	Value unsafe.Pointer
}

type GoItab

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

type GoPtrType

type GoPtrType struct {
	GoType
	Elem *GoType
}

type GoType

type GoType struct {
	Size       uintptr
	PtrData    uintptr
	Hash       uint32
	Flags      uint8
	Align      uint8
	FieldAlign uint8
	KindFlags  uint8
	Traits     unsafe.Pointer
	GCData     *byte
	Str        int32
	PtrToSelf  int32
}

func PtrElem

func PtrElem(t *GoType) *GoType

func UnpackNonEface

func UnpackNonEface(p unsafe.Pointer) *GoType

func UnpackType

func UnpackType(t reflect.Type) *GoType

type Mask

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

type N

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

type SliceHeader

type SliceHeader struct {
	Data unsafe.Pointer
	Len  int
	Cap  int
}

type StringHeader

type StringHeader struct {
	Data unsafe.Pointer
	Len  int
}

type TagInfo

type TagInfo struct {
	TagName      string       //
	BaseType     reflect.Type //
	BaseKind     reflect.Kind // 次成员可能是 **string,[]int 等这种复杂类型,这个 用来指示 "最里层" 的类型
	Offset       uintptr      //偏移量
	TypeSize     int          //
	StringTag    bool         // `json:"field,string"`: 此情形下,需要把struct的int转成json的string
	OmitemptyTag bool         //  `json:"some_field,omitempty"`

	/*
		MChildrenEnable: true 时表示使用 MChildren
		Children: son 超过 128 时tagMap解析很慢,用 map 替代
		ChildList: 遍历 map 性能较差,加个 list
	*/
	MChildrenEnable bool
	Children        map[string]*TagInfo
	ChildList       []*TagInfo // 遍历的顺序和速度
	MChildren       tagMap

	SPool  sync.Pool // TODO:slice pool 和 store.pool 放在一起吧,通过 id 来获取获取 pool,并把剩余的”垃圾“放回 sync.Pool 中共下次复用
	SPoolN int32
	// contains filtered or unexported fields
}

TagInfo 拥有tag的struct的成员的解析结果

func TagMapGetV

func TagMapGetV(m *tagMap, k string) (v *TagInfo)

func TagMapGetV4

func TagMapGetV4(m *tagMap, k string) (v *TagInfo)

type Value

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

Jump to

Keyboard shortcuts

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