Documentation
¶
Index ¶
- Constants
- Variables
- 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 GCAlloc(size uintptr) unsafe.Pointer
- func GCAllocZeroed(size uintptr) unsafe.Pointer
- func Init()
- func Int16LE(p unsafe.Pointer) int16
- func IsPowerOfTwo(n int) bool
- func LogarithmicRange(min, max int, cb func(int))
- func Move(to, from unsafe.Pointer, n uintptr)
- func Sizeof(ptr Pointer) uintptr
- func Uint16LE(p unsafe.Pointer) uint16
- func Zero(ptr unsafe.Pointer, n uintptr)
- type Bytes
- 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 PointerOfString(s string) Pointer
- 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) AsFloat32BE() float32
- func (p Pointer) AsFloat32LE() float32
- func (p Pointer) AsFloat64BE() float64
- func (p Pointer) AsFloat64LE() float64
- func (p Pointer) AsInt16BE() int16
- func (p Pointer) AsInt16LE() int16
- func (p Pointer) AsInt32BE() int32
- func (p Pointer) AsInt32LE() int32
- func (p Pointer) AsInt64BE() int64
- func (p Pointer) AsInt64LE() int64
- func (p Pointer) AsUint16BE() uint16
- func (p Pointer) AsUint16LE() uint16
- func (p Pointer) AsUint32BE() uint32
- func (p Pointer) AsUint32LE() uint32
- func (p Pointer) AsUint64BE() uint64
- func (p Pointer) AsUint64LE() uint64
- 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) 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) Int32Alt(offset uintptr) 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) 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) Size() int
- func (p Pointer) SizeOf() uintptr
- func (p Pointer) String(offset, size int) string
- 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) Zero(size uintptr)
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 ¶
var ArrowAllocator arrowAllocator
Functions ¶
func FloorToPowerOfTwo ¶
FloorToPowerOfTwo returns the greatest power of two integer value less than or equal to n.
func GCAllocZeroed ¶
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 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 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 PointerOfString ¶
func (Pointer) AsFloat32BE ¶
func (Pointer) AsFloat32LE ¶
func (Pointer) AsFloat64BE ¶
func (Pointer) AsFloat64LE ¶
func (Pointer) AsUint16BE ¶
func (Pointer) AsUint16LE ¶
func (Pointer) AsUint32BE ¶
func (Pointer) AsUint32LE ¶
func (Pointer) AsUint64BE ¶
func (Pointer) AsUint64LE ¶
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.