Documentation
¶
Index ¶
- Constants
- func Cmp(a, b string) int
- func Compare(a, b unsafe.Pointer, n uintptr) int
- func Copy(dst, src unsafe.Pointer, n uintptr)
- func Equals(a, b unsafe.Pointer, size uintptr) bool
- func Fastrand() uint32
- func FloorToPowerOfTwo(n int) int
- func Free(p Pointer)
- func Init()
- func IsPowerOfTwo(n int) bool
- func LogarithmicRange(min, max int, cb func(int))
- func Move(to, from unsafe.Pointer, n uintptr)
- func PrintDebugInfo()
- func Scope(fn func(a AutoFree))
- func SizeOf(ptr Pointer) uintptr
- func Zero(ptr unsafe.Pointer, n uintptr)
- type AutoFree
- func (af AutoFree) Alloc(size uintptr) Pointer
- func (af AutoFree) AllocCap(size uintptr) FatPointer
- func (af AutoFree) Bytes(size uintptr) Bytes
- func (af *AutoFree) Close() error
- func (af AutoFree) Count() uintptr
- func (af *AutoFree) Free()
- func (af *AutoFree) HasNext() bool
- func (af AutoFree) Max() uintptr
- func (af *AutoFree) Next() AutoFree
- func (af *AutoFree) Print()
- func (af *AutoFree) Scope(fn func(AutoFree))
- func (af AutoFree) Size() uintptr
- type Bytes
- func (s *Bytes) Append(value Bytes)
- func (s *Bytes) AppendByte(value byte)
- func (s *Bytes) AppendBytes(value []byte)
- func (s *Bytes) AppendFloat32(value float32)
- func (s *Bytes) AppendFloat32BE(value float32)
- func (s *Bytes) AppendFloat32LE(value float32)
- func (s *Bytes) AppendFloat64(value float64)
- func (s *Bytes) AppendFloat64BE(value float64)
- func (s *Bytes) AppendFloat64LE(value float64)
- func (s *Bytes) AppendInt(value int)
- func (s *Bytes) AppendInt16(value int16)
- func (s *Bytes) AppendInt16BE(value int16)
- func (s *Bytes) AppendInt16LE(value int16)
- func (s *Bytes) AppendInt24(value int32)
- func (s *Bytes) AppendInt24BE(value int32)
- func (s *Bytes) AppendInt24LE(value int32)
- func (s *Bytes) AppendInt32(value int32)
- func (s *Bytes) AppendInt32BE(value int32)
- func (s *Bytes) AppendInt32LE(value int32)
- func (s *Bytes) AppendInt40(value int64)
- func (s *Bytes) AppendInt40BE(value int64)
- func (s *Bytes) AppendInt40LE(value int64)
- func (s *Bytes) AppendInt48(value int64)
- func (s *Bytes) AppendInt48BE(value int64)
- func (s *Bytes) AppendInt48LE(value int64)
- func (s *Bytes) AppendInt56(value int64)
- func (s *Bytes) AppendInt56BE(value int64)
- func (s *Bytes) AppendInt56LE(value int64)
- func (s *Bytes) AppendInt64(value int64)
- func (s *Bytes) AppendInt64BE(value int64)
- func (s *Bytes) AppendInt64LE(value int64)
- func (s *Bytes) AppendInt8(value int8)
- func (s *Bytes) AppendPointer(value Pointer)
- func (s *Bytes) AppendString(value string)
- func (s *Bytes) AppendUInt(value uint)
- func (s *Bytes) AppendUInt16(value uint16)
- func (s *Bytes) AppendUInt16BE(value uint16)
- func (s *Bytes) AppendUInt16LE(value uint16)
- func (s *Bytes) AppendUInt24(value uint32)
- func (s *Bytes) AppendUInt24BE(value uint32)
- func (s *Bytes) AppendUInt24LE(value uint32)
- func (s *Bytes) AppendUInt32(value uint32)
- func (s *Bytes) AppendUInt32BE(value uint32)
- func (s *Bytes) AppendUInt32LE(value uint32)
- func (s *Bytes) AppendUInt40(value uint64)
- func (s *Bytes) AppendUInt40BE(value uint64)
- func (s *Bytes) AppendUInt40LE(value uint64)
- func (s *Bytes) AppendUInt48(value uint64)
- func (s *Bytes) AppendUInt48BE(value uint64)
- func (s *Bytes) AppendUInt48LE(value uint64)
- func (s *Bytes) AppendUInt56(value uint64)
- func (s *Bytes) AppendUInt56BE(value uint64)
- func (s *Bytes) AppendUInt56LE(value uint64)
- func (s *Bytes) AppendUInt64(value uint64)
- func (s *Bytes) AppendUInt64BE(value uint64)
- func (s *Bytes) AppendUInt64LE(value uint64)
- func (s *Bytes) AppendUInt8(value uint8)
- func (s *Bytes) AppendUintptr(value uintptr)
- func (s *Bytes) Byte(offset int) byte
- func (s *Bytes) Bytes() []byte
- func (s *Bytes) CString() unsafe.Pointer
- func (b Bytes) Cap() int
- func (s *Bytes) CheckBounds(offset int) bool
- func (s *Bytes) Clone() Bytes
- func (s *Bytes) EnsureCap(neededCap int) bool
- func (s *Bytes) EnsureLen(neededLen int)
- func (s *Bytes) Equals(o Bytes) bool
- func (s *Bytes) Float32(offset int) float32
- func (s *Bytes) Float32BE(offset int) float32
- func (s *Bytes) Float32LE(offset int) float32
- func (s *Bytes) Float64(offset int) float64
- func (s *Bytes) Float64BE(offset int) float64
- func (s *Bytes) Float64LE(offset int) float64
- func (s *Bytes) Free()
- func (s *Bytes) Hash32() uint32
- func (s *Bytes) Hash64() uint64
- func (s *Bytes) Int(offset int) int
- func (s *Bytes) Int16(offset int) int16
- func (s *Bytes) Int16BE(offset int) int16
- func (s *Bytes) Int16LE(offset int) int16
- func (s *Bytes) Int24(offset int) int32
- func (s *Bytes) Int24BE(offset int) int32
- func (s *Bytes) Int24LE(offset int) int32
- func (s *Bytes) Int32(offset int) int32
- func (s *Bytes) Int32BE(offset int) int32
- func (s *Bytes) Int32LE(offset int) int32
- func (s *Bytes) Int40(offset int) int64
- func (s *Bytes) Int40BE(offset int) int64
- func (s *Bytes) Int40LE(offset int) int64
- func (s *Bytes) Int48(offset int) int64
- func (s *Bytes) Int48BE(offset int) int64
- func (s *Bytes) Int48LE(offset int) int64
- func (s *Bytes) Int56(offset int) int64
- func (s *Bytes) Int56BE(offset int) int64
- func (s *Bytes) Int56LE(offset int) int64
- func (s *Bytes) Int64(offset int) int64
- func (s *Bytes) Int64BE(offset int) int64
- func (s *Bytes) Int64LE(offset int) int64
- func (s *Bytes) Int8(offset int) int8
- func (s Bytes) IsEmpty() bool
- func (s *Bytes) IsNil() bool
- func (b Bytes) Len() int
- func (s *Bytes) Metro64(seed uint64, offset, length int) uint64
- func (s *Bytes) PointerAt(offset int) Pointer
- func (s *Bytes) Reset()
- func (s *Bytes) Set(offset int, value Bytes)
- func (s *Bytes) SetByte(offset int, value byte)
- func (s *Bytes) SetBytes(offset int, value []byte)
- func (s *Bytes) SetFloat32(offset int, value float32)
- func (s *Bytes) SetFloat32BE(offset int, value float32)
- func (s *Bytes) SetFloat32LE(offset int, value float32)
- func (s *Bytes) SetFloat64(offset int, value float64)
- func (s *Bytes) SetFloat64BE(offset int, value float64)
- func (s *Bytes) SetFloat64LE(offset int, value float64)
- func (s *Bytes) SetInt(offset int, value int)
- func (s *Bytes) SetInt16(offset int, value int16)
- func (s *Bytes) SetInt16BE(offset int, value int16)
- func (s *Bytes) SetInt16LE(offset int, value int16)
- func (s *Bytes) SetInt24(offset int, value int32)
- func (s *Bytes) SetInt24BE(offset int, value int32)
- func (s *Bytes) SetInt24LE(offset int, value int32)
- func (s *Bytes) SetInt32(offset int, value int32)
- func (s *Bytes) SetInt32BE(offset int, value int32)
- func (s *Bytes) SetInt32LE(offset int, value int32)
- func (s *Bytes) SetInt40(offset int, value int64)
- func (s *Bytes) SetInt40BE(offset int, value int64)
- func (s *Bytes) SetInt40LE(offset int, value int64)
- func (s *Bytes) SetInt48(offset int, value int64)
- func (s *Bytes) SetInt48BE(offset int, value int64)
- func (s *Bytes) SetInt48LE(offset int, value int64)
- func (s *Bytes) SetInt56(offset int, value int64)
- func (s *Bytes) SetInt56BE(offset int, value int64)
- func (s *Bytes) SetInt56LE(offset int, value int64)
- func (s *Bytes) SetInt64(offset int, value int64)
- func (s *Bytes) SetInt64BE(offset int, value int64)
- func (s *Bytes) SetInt64LE(offset int, value int64)
- func (s *Bytes) SetInt8(offset int, value int8)
- func (s *Bytes) SetLength(length int)
- func (s *Bytes) SetPointer(offset int, value Pointer)
- func (s *Bytes) SetString(offset int, value string)
- func (s *Bytes) SetUInt(offset int, value uint)
- func (s *Bytes) SetUInt16(offset int, value uint16)
- func (s *Bytes) SetUInt16BE(offset int, value uint16)
- func (s *Bytes) SetUInt16LE(offset int, value uint16)
- func (s *Bytes) SetUInt24(offset int, value uint32)
- func (s *Bytes) SetUInt24BE(offset int, value uint32)
- func (s *Bytes) SetUInt24LE(offset int, value uint32)
- func (s *Bytes) SetUInt32(offset int, value uint32)
- func (s *Bytes) SetUInt32BE(offset int, value uint32)
- func (s *Bytes) SetUInt32LE(offset int, value uint32)
- func (s *Bytes) SetUInt40(offset int, value uint64)
- func (s *Bytes) SetUInt40BE(offset int, value uint64)
- func (s *Bytes) SetUInt40LE(offset int, value uint64)
- func (s *Bytes) SetUInt48(offset int, value uint64)
- func (s *Bytes) SetUInt48BE(offset int, value uint64)
- func (s *Bytes) SetUInt48LE(offset int, value uint64)
- func (s *Bytes) SetUInt56(offset int, value uint64)
- func (s *Bytes) SetUInt56BE(offset int, value uint64)
- func (s *Bytes) SetUInt56LE(offset int, value uint64)
- func (s *Bytes) SetUInt64(offset int, value uint64)
- func (s *Bytes) SetUInt64BE(offset int, value uint64)
- func (s *Bytes) SetUInt64LE(offset int, value uint64)
- func (s *Bytes) SetUInt8(offset int, value uint8)
- func (s *Bytes) SetUintptr(offset int, value uintptr)
- func (s *Bytes) String() string
- func (s *Bytes) UInt(offset int) int
- func (s *Bytes) UInt16(offset int) uint16
- func (s *Bytes) UInt16BE(offset int) uint16
- func (s *Bytes) UInt16LE(offset int) uint16
- func (s *Bytes) UInt24(offset int) uint32
- func (s *Bytes) UInt24BE(offset int) uint32
- func (s *Bytes) UInt24LE(offset int) uint32
- func (s *Bytes) UInt32(offset int) uint32
- func (s *Bytes) UInt32BE(offset int) uint32
- func (s *Bytes) UInt32LE(offset int) uint32
- func (s *Bytes) UInt40(offset int) uint64
- func (s *Bytes) UInt40BE(offset int) uint64
- func (s *Bytes) UInt40LE(offset int) uint64
- func (s *Bytes) UInt48(offset int) uint64
- func (s *Bytes) UInt48BE(offset int) uint64
- func (s *Bytes) UInt48LE(offset int) uint64
- func (s *Bytes) UInt56(offset int) uint64
- func (s *Bytes) UInt56BE(offset int) uint64
- func (s *Bytes) UInt56LE(offset int) uint64
- func (s *Bytes) UInt64(offset int) uint64
- func (s *Bytes) UInt64BE(offset int) uint64
- func (s *Bytes) UInt64LE(offset int) uint64
- func (s *Bytes) UInt8(offset int) uint8
- func (s *Bytes) Uintptr(offset int) uintptr
- func (s *Bytes) WyHash64(seed uint64, offset, length int) uint64
- func (s Bytes) Zero()
- type FatPointer
- type GCObject
- type GCStats
- type HeapStats
- type Pointer
- func Alloc(size uintptr) Pointer
- func AllocCap(size uintptr) (Pointer, uintptr)
- func AllocZeroed(size uintptr) Pointer
- func AllocZeroedCap(size uintptr) (Pointer, uintptr)
- func Calloc(num, size uintptr) Pointer
- func CallocCap(num, size uintptr) (Pointer, uintptr)
- func Realloc(p Pointer, size uintptr) Pointer
- func ReallocCap(p Pointer, size uintptr) (Pointer, uintptr)
- func (p Pointer) Add(offset int) Pointer
- func (p Pointer) Byte(offset int) byte
- func (p Pointer) Bytes(offset, length, capacity int) []byte
- func (p Pointer) Clone(offset, size int) Pointer
- func (p Pointer) Compare(offset, size int, to Pointer) int
- func (p Pointer) Copy(offset, size int, to Pointer)
- func (p Pointer) Equals(offset, size int, to Pointer) bool
- func (p Pointer) Float32(offset int) float32
- func (p Pointer) Float32BE(offset int) float32
- func (p Pointer) Float32LE(offset int) float32
- func (p Pointer) Float64(offset int) float64
- func (p Pointer) Float64BE(offset int) float64
- func (p Pointer) Float64LE(offset int) float64
- func (p *Pointer) Free()
- func (p Pointer) Hash32(length int) uint32
- func (p Pointer) Hash32At(offset, length int) uint32
- func (p Pointer) Hash64(length int) uint64
- func (p Pointer) Hash64At(offset, length int) uint64
- func (p Pointer) Int(offset int) int
- func (p Pointer) Int16(offset int) int16
- func (p Pointer) Int16BE(offset int) int16
- func (p Pointer) Int16LE(offset int) int16
- func (p Pointer) Int24(offset int) int32
- func (p Pointer) Int24BE(offset int) int32
- func (p Pointer) Int24LE(offset int) int32
- func (p Pointer) Int32(offset int) int32
- func (p Pointer) Int32BE(offset int) int32
- func (p Pointer) Int32LE(offset int) int32
- func (p Pointer) Int40(offset int) int64
- func (p Pointer) Int40BE(offset int) int64
- func (p Pointer) Int40LE(offset int) int64
- func (p Pointer) Int48(offset int) int64
- func (p Pointer) Int48BE(offset int) int64
- func (p Pointer) Int48LE(offset int) int64
- func (p Pointer) Int56(offset int) int64
- func (p Pointer) Int56BE(offset int) int64
- func (p Pointer) Int56LE(offset int) int64
- func (p Pointer) Int64(offset int) int64
- func (p Pointer) Int64BE(offset int) int64
- func (p Pointer) Int64LE(offset int) int64
- func (p Pointer) Int8(offset int) int8
- func (p Pointer) Metro64(seed uint64, offset, length int) uint64
- func (p Pointer) Move(offset, size int, to Pointer)
- func (p Pointer) Pointer(offset int) Pointer
- func (p Pointer) SetByte(offset int, v byte)
- func (p Pointer) SetBytes(offset int, value []byte)
- func (p Pointer) SetFloat32(offset int, v float32)
- func (p Pointer) SetFloat32BE(offset int, v float32)
- func (p Pointer) SetFloat32LE(offset int, v float32)
- func (p Pointer) SetFloat64(offset int, v float64)
- func (p Pointer) SetFloat64BE(offset int, v float64)
- func (p Pointer) SetFloat64LE(offset int, v float64)
- func (p Pointer) SetInt(offset int, v int)
- func (p Pointer) SetInt16(offset int, v int16)
- func (p Pointer) SetInt16BE(offset int, v int16)
- func (p Pointer) SetInt16LE(offset int, v int16)
- func (p Pointer) SetInt24(offset int, v int32)
- func (p Pointer) SetInt24BE(offset int, v int32)
- func (p Pointer) SetInt24LE(offset int, v int32)
- func (p Pointer) SetInt32(offset int, v int32)
- func (p Pointer) SetInt32BE(offset int, v int32)
- func (p Pointer) SetInt32LE(offset int, v int32)
- func (p Pointer) SetInt40(offset int, v int64)
- func (p Pointer) SetInt40BE(offset int, v int64)
- func (p Pointer) SetInt40LE(offset int, v int64)
- func (p Pointer) SetInt48(offset int, v int64)
- func (p Pointer) SetInt48BE(offset int, v int64)
- func (p Pointer) SetInt48LE(offset int, v int64)
- func (p Pointer) SetInt56(offset int, v int64)
- func (p Pointer) SetInt56BE(offset int, v int64)
- func (p Pointer) SetInt56LE(offset int, v int64)
- func (p Pointer) SetInt64(offset int, v int64)
- func (p Pointer) SetInt64BE(offset int, v int64)
- func (p Pointer) SetInt64LE(offset int, v int64)
- func (p Pointer) SetInt8(offset int, v int8)
- func (p Pointer) SetPointer(offset int, v Pointer)
- func (p Pointer) SetString(offset int, value string)
- func (p Pointer) SetUInt(offset int, v uint)
- func (p Pointer) SetUInt16(offset int, v uint16)
- func (p Pointer) SetUInt16BE(offset int, v uint16)
- func (p Pointer) SetUInt16LE(offset int, v uint16)
- func (p Pointer) SetUInt24(offset int, v uint32)
- func (p Pointer) SetUInt24BE(offset int, v uint32)
- func (p Pointer) SetUInt24LE(offset int, v uint32)
- func (p Pointer) SetUInt32(offset int, v uint32)
- func (p Pointer) SetUInt32BE(offset int, v uint32)
- func (p Pointer) SetUInt32LE(offset int, v uint32)
- func (p Pointer) SetUInt40(offset int, v uint64)
- func (p Pointer) SetUInt40BE(offset int, v uint64)
- func (p Pointer) SetUInt40LE(offset int, v uint64)
- func (p Pointer) SetUInt48(offset int, v uint64)
- func (p Pointer) SetUInt48BE(offset int, v uint64)
- func (p Pointer) SetUInt48LE(offset int, v uint64)
- func (p Pointer) SetUInt56(offset int, v uint64)
- func (p Pointer) SetUInt56BE(offset int, v uint64)
- func (p Pointer) SetUInt56LE(offset int, v uint64)
- func (p Pointer) SetUInt64(offset int, v uint64)
- func (p Pointer) SetUInt64BE(offset int, v uint64)
- func (p Pointer) SetUInt64LE(offset int, v uint64)
- func (p Pointer) SetUInt8(offset int, v uint8)
- func (p Pointer) SetUintptr(offset int, v uintptr)
- func (p Pointer) SizeOf() uintptr
- func (p Pointer) String(offset, size int) string
- func (p Pointer) ToFat(length int) FatPointer
- func (p Pointer) UInt(offset int) uint
- func (p Pointer) UInt16(offset int) uint16
- func (p Pointer) UInt16BE(offset int) uint16
- func (p Pointer) UInt16LE(offset int) uint16
- func (p Pointer) UInt24(offset int) uint32
- func (p Pointer) UInt24BE(offset int) uint32
- func (p Pointer) UInt24LE(offset int) uint32
- func (p Pointer) UInt32(offset int) uint32
- func (p Pointer) UInt32BE(offset int) uint32
- func (p Pointer) UInt32BESlow() uint32
- func (p Pointer) UInt32LE(offset int) uint32
- func (p Pointer) UInt40(offset int) uint64
- func (p Pointer) UInt40BE(offset int) uint64
- func (p Pointer) UInt40LE(offset int) uint64
- func (p Pointer) UInt48(offset int) uint64
- func (p Pointer) UInt48BE(offset int) uint64
- func (p Pointer) UInt48LE(offset int) uint64
- func (p Pointer) UInt56(offset int) uint64
- func (p Pointer) UInt56BE(offset int) uint64
- func (p Pointer) UInt56LE(offset int) uint64
- func (p Pointer) UInt64(offset int) uint64
- func (p Pointer) UInt64BE(offset int) uint64
- func (p Pointer) UInt64LE(offset int) uint64
- func (p Pointer) UInt8(offset int) uint8
- func (p Pointer) Uintptr(offset int) uintptr
- func (p Pointer) Unsafe() unsafe.Pointer
- func (p Pointer) WyHash64(seed uint64, offset, length int) uint64
- func (p Pointer) Zero(size uintptr)
- type PointerSet
- func (ps *PointerSet) Add(key uintptr, depth int) (bool, bool)
- func (ps *PointerSet) Close() error
- func (ps *PointerSet) Delete(key uintptr) (uintptr, bool)
- func (ps *PointerSet) Grow() bool
- func (ps *PointerSet) Has(key uintptr) bool
- func (ps *PointerSet) Reset()
- func (ps *PointerSet) Set(key uintptr) (bool, bool)
Constants ¶
const PtrSize = 4 << (^uintptr(0) >> 63)
PtrSize is the size of a pointer in bytes - unsafe.Sizeof(uintptr(0)) but as an ideal constant. It is also the size of the machine's native word size (that is, 4 on 32-bit systems, 8 on 64-bit).
Variables ¶
This section is empty.
Functions ¶
func FloorToPowerOfTwo ¶
FloorToPowerOfTwo returns the greatest power of two integer value less than or equal to n.
func IsPowerOfTwo ¶
IsPowerOfTwo reports whether given integer is a power of two.
func LogarithmicRange ¶
LogarithmicRange iterates from ceiled to power of two min to max, calling cb on each iteration.
func Move ¶
Move copies n bytes from "from" to "to".
Move ensures that any pointer in "from" is written to "to" with an indivisible write, so that racy reads cannot observe a half-written pointer. This is necessary to prevent the garbage collector from observing invalid pointers, and differs from Memmove in unmanaged languages. However, Memmove is only required to do this if "from" and "to" may contain pointers, which can only be the case if "from", "to", and "n" are all be word-aligned.
Implementations are in memmove_*.s.
func PrintDebugInfo ¶
func PrintDebugInfo()
func Zero ¶
Zero clears n bytes starting at ptr.
Usually you should use typedmemclr. memclrNoHeapPointers should be used only when the caller knows that *ptr contains no heap pointers because either:
*ptr is initialized memory and its type is pointer-free, or
*ptr is uninitialized memory (e.g., memory that's being reused for a new allocation) and hence contains only "junk".
memclrNoHeapPointers ensures that if ptr is pointer-aligned, and n is a multiple of the pointer size, then any pointer-aligned, pointer-sized portion is cleared atomically. Despite the function name, this is necessary because this function is the underlying implementation of typedmemclr and memclrHasPointers. See the doc of Memmove for more details.
The (CPU-specific) implementations of this function are in memclr_*.s.
Types ¶
type AutoFree ¶
type AutoFree uintptr
AutoFree is a singly linked list (Stack) of nodes which contain pointers that will all free when Free is called. uintptr is used to ensure the compiler doesn't confuse it for a Go GC managed pointer.
func (AutoFree) AllocCap ¶
func (af AutoFree) AllocCap(size uintptr) FatPointer
type Bytes ¶
type Bytes struct {
Pointer // Use for unchecked unsafe access
}
Bytes is a compact single dynamic allocation to be used as an unsafe replacement for string.
func AllocBytes ¶
func WrapString ¶
func (*Bytes) AppendByte ¶
func (*Bytes) AppendBytes ¶
func (*Bytes) AppendFloat32 ¶
func (*Bytes) AppendFloat32BE ¶
func (*Bytes) AppendFloat32LE ¶
func (*Bytes) AppendFloat64 ¶
func (*Bytes) AppendFloat64BE ¶
func (*Bytes) AppendFloat64LE ¶
func (*Bytes) AppendInt16 ¶
func (*Bytes) AppendInt16BE ¶
func (*Bytes) AppendInt16LE ¶
func (*Bytes) AppendInt24 ¶
func (*Bytes) AppendInt24BE ¶
func (*Bytes) AppendInt24LE ¶
func (*Bytes) AppendInt32 ¶
func (*Bytes) AppendInt32BE ¶
func (*Bytes) AppendInt32LE ¶
func (*Bytes) AppendInt40 ¶
func (*Bytes) AppendInt40BE ¶
func (*Bytes) AppendInt40LE ¶
func (*Bytes) AppendInt48 ¶
func (*Bytes) AppendInt48BE ¶
func (*Bytes) AppendInt48LE ¶
func (*Bytes) AppendInt56 ¶
func (*Bytes) AppendInt56BE ¶
func (*Bytes) AppendInt56LE ¶
func (*Bytes) AppendInt64 ¶
func (*Bytes) AppendInt64BE ¶
func (*Bytes) AppendInt64LE ¶
func (*Bytes) AppendInt8 ¶
func (*Bytes) AppendPointer ¶
func (*Bytes) AppendString ¶
func (*Bytes) AppendUInt ¶
func (*Bytes) AppendUInt16 ¶
func (*Bytes) AppendUInt16BE ¶
func (*Bytes) AppendUInt16LE ¶
func (*Bytes) AppendUInt24 ¶
func (*Bytes) AppendUInt24BE ¶
func (*Bytes) AppendUInt24LE ¶
func (*Bytes) AppendUInt32 ¶
func (*Bytes) AppendUInt32BE ¶
func (*Bytes) AppendUInt32LE ¶
func (*Bytes) AppendUInt40 ¶
func (*Bytes) AppendUInt40BE ¶
func (*Bytes) AppendUInt40LE ¶
func (*Bytes) AppendUInt48 ¶
func (*Bytes) AppendUInt48BE ¶
func (*Bytes) AppendUInt48LE ¶
func (*Bytes) AppendUInt56 ¶
func (*Bytes) AppendUInt56BE ¶
func (*Bytes) AppendUInt56LE ¶
func (*Bytes) AppendUInt64 ¶
func (*Bytes) AppendUInt64BE ¶
func (*Bytes) AppendUInt64LE ¶
func (*Bytes) AppendUInt8 ¶
func (*Bytes) AppendUintptr ¶
func (*Bytes) CheckBounds ¶
func (*Bytes) EnsureLen ¶
EnsureLen ensures the length is at least neededLen in size If not, EnsureCap(neededLen) is called and the length set to neededLen.
func (*Bytes) Reset ¶
func (s *Bytes) Reset()
Reset zeroes out the entire allocation and sets the length back to 0
func (*Bytes) SetFloat32 ¶
func (*Bytes) SetFloat32BE ¶
func (*Bytes) SetFloat32LE ¶
func (*Bytes) SetFloat64 ¶
func (*Bytes) SetFloat64BE ¶
func (*Bytes) SetFloat64LE ¶
func (*Bytes) SetInt16BE ¶
func (*Bytes) SetInt16LE ¶
func (*Bytes) SetInt24BE ¶
func (*Bytes) SetInt24LE ¶
func (*Bytes) SetInt32BE ¶
func (*Bytes) SetInt32LE ¶
func (*Bytes) SetInt40BE ¶
func (*Bytes) SetInt40LE ¶
func (*Bytes) SetInt48BE ¶
func (*Bytes) SetInt48LE ¶
func (*Bytes) SetInt56BE ¶
func (*Bytes) SetInt56LE ¶
func (*Bytes) SetInt64BE ¶
func (*Bytes) SetInt64LE ¶
func (*Bytes) SetPointer ¶
func (*Bytes) SetUInt16BE ¶
func (*Bytes) SetUInt16LE ¶
func (*Bytes) SetUInt24BE ¶
func (*Bytes) SetUInt24LE ¶
func (*Bytes) SetUInt32BE ¶
func (*Bytes) SetUInt32LE ¶
func (*Bytes) SetUInt40BE ¶
func (*Bytes) SetUInt40LE ¶
func (*Bytes) SetUInt48BE ¶
func (*Bytes) SetUInt48LE ¶
func (*Bytes) SetUInt56BE ¶
func (*Bytes) SetUInt56LE ¶
func (*Bytes) SetUInt64BE ¶
func (*Bytes) SetUInt64LE ¶
func (*Bytes) SetUintptr ¶
type FatPointer ¶
type FatPointer struct {
Pointer
// contains filtered or unexported fields
}
func FatPointerOf ¶
func FatPointerOf(p Pointer, length uintptr) FatPointer
func (FatPointer) Bytes ¶
func (fp FatPointer) Bytes() []byte
func (FatPointer) Clone ¶
func (fp FatPointer) Clone() FatPointer
func (FatPointer) CloneAsBytes ¶
func (fp FatPointer) CloneAsBytes() Bytes
func (*FatPointer) Len ¶
func (fp *FatPointer) Len() uintptr
func (FatPointer) String ¶
func (fp FatPointer) String() string
type GCStats ¶
type GCStats struct {
Started int64 // Epoch in nanos when GC was first started
Cycles int64 // Number of times GC collect Has ran
Live int64 // Number of live objects
TotalAllocs int64 // Count of all allocations created
TotalBytes int64 // Sum of all allocation's size in bytes
Frees int64 // Count of times an allocation was freed instead of swept
FreedBytes int64 // Sum of all freed allocation's size in bytes
Sweeps int64 // Count of times an allocation was swept instead of freed
SweepBytes int64 // Sum of all swept allocation's size in bytes
SweepTime int64 // Sum of all time in nanos spent during the Sweep phase
SweepTimeMin int64 // Minimum time in nanos spent during a single Sweep phase
SweepTimeMax int64 // Maximum time in nanos spent during a single Sweep phase
SweepTimeAvg int64 // Average time in nanos spent during a single Sweep phase
Roots int64 //
RootsMin int64 //
RootsMax int64 //
RootsTimeMin int64 //
RootsTimeMax int64 //
RootsTimeAvg int64 //
GraphDepth int64 //
GraphMinDepth int64 //
GraphMaxDepth int64 //
GraphAvgDepth int64 //
GraphTimeMin int64 //
GraphTimeMax int64 //
GraphTimeAvg int64 //
TotalTime int64 // Sum of all time in nanos spent doing GC collect
MinTime int64 // Minimum time in nanos spent during a single GC collect
MaxTime int64 // Maximum time in nanos spent during a single GC collect
AvgTime int64 // Average time in nanos spent during a single GC collect
LastMarkRootsTime int64 // Time in nanos spent during the most recent GC collect "Mark Roots" phase
LastMarkGraphTime int64 // Time in nanos spent during the most recent GC collect "Mark Graph" phase
LastSweepTime int64 // Time in nanos spent during the most recent GC collect "Sweep" phase
LastGCTime int64 // Time in nanos spent during the most recent GC collect
LastSweep int64 // Number of allocations that were swept during the most recent GC collect "Sweep" phase
LastSweepBytes int64 // Number of bytes reclaimed during the most recent GC collect "Sweep" phase
LiveBytes uintptr // Sum of all live allocation's size in bytes
}
GCStats provides all the monitoring metrics needed to see how the GC is operating and performing.
type HeapStats ¶
type HeapStats struct {
HeapSize int64
AllocSize int64
PeakAllocSize int64
FreeSize int64
Allocs int32
InitialPages int32
ConsecutiveLow int32
ConsecutiveHigh int32
Pages int32
Grows int32
// contains filtered or unexported fields
}
HeapStats provides the metrics of an Allocator
func (*HeapStats) Fragmentation ¶
type Pointer ¶
type Pointer uintptr
Pointer is a wrapper around a raw pointer that is not unsafe.Pointer so Go won't confuse it for a potential GC managed pointer.
func AllocZeroed ¶
func AllocZeroedCap ¶
func (Pointer) Clone ¶
Clone the memory starting at offset for size number of bytes and return the new Pointer.
func (Pointer) SetFloat32 ¶
func (Pointer) SetFloat32BE ¶
func (Pointer) SetFloat32LE ¶
func (Pointer) SetFloat64 ¶
func (Pointer) SetFloat64BE ¶
func (Pointer) SetFloat64LE ¶
func (Pointer) SetInt16BE ¶
func (Pointer) SetInt16LE ¶
func (Pointer) SetInt24BE ¶
func (Pointer) SetInt24LE ¶
func (Pointer) SetInt32BE ¶
func (Pointer) SetInt32LE ¶
func (Pointer) SetInt40BE ¶
func (Pointer) SetInt40LE ¶
func (Pointer) SetInt48BE ¶
func (Pointer) SetInt48LE ¶
func (Pointer) SetInt56BE ¶
func (Pointer) SetInt56LE ¶
func (Pointer) SetInt64BE ¶
func (Pointer) SetInt64LE ¶
func (Pointer) SetPointer ¶
func (Pointer) SetUInt16BE ¶
func (Pointer) SetUInt16LE ¶
func (Pointer) SetUInt24BE ¶
func (Pointer) SetUInt24LE ¶
func (Pointer) SetUInt32BE ¶
func (Pointer) SetUInt32LE ¶
func (Pointer) SetUInt40BE ¶
func (Pointer) SetUInt40LE ¶
func (Pointer) SetUInt48BE ¶
func (Pointer) SetUInt48LE ¶
func (Pointer) SetUInt56BE ¶
func (Pointer) SetUInt56LE ¶
func (Pointer) SetUInt64BE ¶
func (Pointer) SetUInt64LE ¶
func (Pointer) SetUintptr ¶
func (Pointer) SizeOf ¶
SizeOf returns the size of the allocation provided by the platform allocator.
func (Pointer) ToFat ¶
func (p Pointer) ToFat(length int) FatPointer
func (Pointer) UInt32BESlow ¶
type PointerSet ¶
type PointerSet struct {
// contains filtered or unexported fields
}
PointerSet is a hashset that uses the robinhood algorithm. This implementation is not concurrent safe.
func NewPointerSet ¶
func NewPointerSet(size uintptr) PointerSet
NewPointerSet returns a new robinhood hashmap.
func (*PointerSet) Add ¶
func (ps *PointerSet) Add(key uintptr, depth int) (bool, bool)
Add inserts or updates a key into the PointerSet. The returned wasNew will be true if the mutation was on a newly seen, inserted key, and wasNew will be false if the mutation was an update to an existing key.
func (*PointerSet) Close ¶
func (ps *PointerSet) Close() error
func (*PointerSet) Delete ¶
func (ps *PointerSet) Delete(key uintptr) (uintptr, bool)
Delete removes a key from the PointerSet.
func (*PointerSet) Grow ¶
func (ps *PointerSet) Grow() bool
func (*PointerSet) Has ¶
func (ps *PointerSet) Has(key uintptr) bool
Has returns whether the key exists in the Add.
func (*PointerSet) Reset ¶
func (ps *PointerSet) Reset()
Reset clears PointerSet, where already allocated memory will be reused.