Versions in this module Expand all Collapse all v0 v0.0.4 Oct 20, 2020 Changes in this version + const MaxArrayLen — darwin/amd64, linux/amd64, windows/amd64 + var NewFile = errors.New("Create a new file") + func CPUTicks() int64 + func Calloc(n int64) []byte + func CallocNoRef(n int) []byte + func FastRand() uint32 + func Free(b []byte) + func HistogramBounds(minExponent, maxExponent uint32) []float64 + func KeyToHash(key interface{}) (uint64, uint64) + func Madvise(b []byte, readahead bool) error + func MemHash(data []byte) uint64 + func MemHashString(str string) uint64 + func Mmap(fd *os.File, writable bool, size int64) ([]byte, error) + func Msync(b []byte) error + func Munmap(b []byte) error + func NanoTime() int64 + func NumAllocBytes() int64 + func PrintAllocators() + func PrintLeaks() + func ReadMemStats(_ *MemStats) + func StatsPrint() + func SyncDir(dir string) error + func ZeroOut(dst []byte, start, end int) + type Allocator struct + Ref uint64 + Tag string + func AllocatorFrom(ref uint64) *Allocator + func NewAllocator(sz int) *Allocator + func (a *Allocator) Allocate(sz int) []byte + func (a *Allocator) AllocateAligned(sz int) []byte + func (a *Allocator) Allocated() uint64 + func (a *Allocator) Copy(buf []byte) []byte + func (a *Allocator) MaxAlloc() int + func (a *Allocator) Release() + func (a *Allocator) Size() uint64 + type Bloom struct + ElemNum uint64 + func JSONUnmarshal(dbData []byte) (*Bloom, error) + func NewBloomFilter(params ...float64) (bloomfilter *Bloom) + func (bl *Bloom) Add(hash uint64) + func (bl *Bloom) AddIfNotHas(hash uint64) bool + func (bl *Bloom) Clear() + func (bl *Bloom) IsSet(idx uint64) bool + func (bl *Bloom) Set(idx uint64) + func (bl *Bloom) Size(sz uint64) + func (bl *Bloom) TotalSize() int + func (bl Bloom) Has(hash uint64) bool + func (bl Bloom) JSONMarshal() []byte + type Buffer struct + func NewBuffer(sz int64) *Buffer + func NewBufferWith(sz, maxSz int64, bufType BufferType) (*Buffer, error) + func (b *Buffer) Allocate(n int64) []byte + func (b *Buffer) AllocateOffset(n int64) int64 + func (b *Buffer) AutoMmapAfter(size int64) + func (b *Buffer) Bytes() []byte + func (b *Buffer) Data(offset int64) []byte + func (b *Buffer) Grow(n int64) + func (b *Buffer) IsEmpty() bool + func (b *Buffer) Len() int64 + func (b *Buffer) Release() error + func (b *Buffer) Reset() + func (b *Buffer) Slice(offset int64) ([]byte, int64) + func (b *Buffer) SliceAllocate(sz int64) []byte + func (b *Buffer) SliceIterate(f func(slice []byte) error) error + func (b *Buffer) SliceOffsets() []int64 + func (b *Buffer) SortSlice(less func(left, right []byte) bool) + func (b *Buffer) SortSliceBetween(start, end int64, less LessFunc) + func (b *Buffer) Write(p []byte) (n int64, err error) + func (b *Buffer) WriteSlice(slice []byte) + type BufferType int + const UseCalloc + const UseInvalid + const UseMmap + func (t BufferType) String() string + type Closer struct + func NewCloser(initial int) *Closer + func (lc *Closer) AddRunning(delta int) + func (lc *Closer) Ctx() context.Context + func (lc *Closer) Done() + func (lc *Closer) HasBeenClosed() <-chan struct{} + func (lc *Closer) Signal() + func (lc *Closer) SignalAndWait() + func (lc *Closer) Wait() + type HistogramData struct + Bounds []float64 + Count int64 + CountPerBucket []int64 + Max int64 + Min int64 + Sum int64 + func NewHistogramData(bounds []float64) *HistogramData + func (histogram *HistogramData) Copy() *HistogramData + func (histogram *HistogramData) Mean() float64 + func (histogram *HistogramData) String() string + func (histogram *HistogramData) Update(value int64) + type LessFunc func(a, b []byte) bool + type MemStats struct + Active uint64 + Allocated uint64 + Resident uint64 + Retained uint64 + type MmapFile struct + Data []byte + Fd *os.File + func OpenMmapFile(filename string, flag int, maxSz int) (*MmapFile, error) + func OpenMmapFileUsing(fd *os.File, maxSz int, writable bool) (*MmapFile, error) + func (m *MmapFile) AllocateSlice(sz, offset int) ([]byte, int) + func (m *MmapFile) Bytes(off, sz int) ([]byte, error) + func (m *MmapFile) Close(maxSz int64) error + func (m *MmapFile) Delete() error + func (m *MmapFile) NewReader(offset int) io.Reader + func (m *MmapFile) Slice(offset int) []byte + func (m *MmapFile) Sync() error + func (m *MmapFile) Truncate(maxSz int64) error