bitset

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitSet

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

BitSet 高效的位集合实现,用于跟踪访问状态

func NewBitSet

func NewBitSet(size int) *BitSet

NewBitSet 创建指定大小的位集合

func (*BitSet) Clear

func (bs *BitSet) Clear(index int)

Clear 清除指定位

func (*BitSet) ClearAll

func (bs *BitSet) ClearAll()

ClearAll 清除所有位

func (*BitSet) Get

func (bs *BitSet) Get(index int) bool

Get 获取指定位的值

func (*BitSet) Set

func (bs *BitSet) Set(index int)

Set 设置指定位

func (*BitSet) Size

func (bs *BitSet) Size() int

Size 返回位集合的大小

type BitSetPool

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

BitSetPool 位集合对象池,用于复用BitSet减少内存分配

func NewBitSetPool

func NewBitSetPool(size int) *BitSetPool

NewBitSetPool 创建指定大小的位集合池

func (*BitSetPool) Get

func (bsp *BitSetPool) Get() *BitSet

Get 从池中获取一个位集合

func (*BitSetPool) Put

func (bsp *BitSetPool) Put(bs *BitSet)

Put 将位集合归还到池中

Jump to

Keyboard shortcuts

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