Documentation ¶
Index ¶
- Constants
- func Hash(v longbits.ByteString, h hash.Hash) hash.Hash
- func IsCompatibleMemoryModel(v MemoryModelSupported) bool
- func KeepAliveWhile(p unsafe.Pointer, fn func(unsafe.Pointer) uintptr) uintptr
- func UnwrapAs(v longbits.ByteString, mt MMapType) interface{}
- func UnwrapAsSliceOf(s longbits.ByteString, mt MMapSliceType) interface{}
- func WrapBytes(b []byte) longbits.ByteString
- func WrapOf(v interface{}, mt MMapType) longbits.ByteString
- func WrapSlice(v interface{}) longbits.ByteString
- func WrapSliceOf(v interface{}, mt MMapSliceType) longbits.ByteString
- func WrapStruct(v interface{}) longbits.ByteString
- func WrapValueStruct(v interface{}) longbits.ByteString
- func WriteTo(v longbits.ByteString, w io.Writer) (n int64, err error)
- type KeepAliveList
- type MMType
- type MMapSliceType
- type MMapType
- type MemoryMapModel
- type MemoryModelSupported
- type Unwrapper
Constants ¶
const BigEndian = false // unfortunately, sys.BigEndian is inaccessible
const PtrSize = 4 << (^uintptr(0) >> 63) // unsafe.Sizeof(uintptr(0)) but an ideal const
Variables ¶
This section is empty.
Functions ¶
func IsCompatibleMemoryModel ¶
func IsCompatibleMemoryModel(v MemoryModelSupported) bool
func KeepAliveWhile ¶
func UnwrapAs ¶
func UnwrapAs(v longbits.ByteString, mt MMapType) interface{}
func UnwrapAsSliceOf ¶
func UnwrapAsSliceOf(s longbits.ByteString, mt MMapSliceType) interface{}
func WrapBytes ¶
func WrapBytes(b []byte) longbits.ByteString
WARNING! The given array MUST be immutable WARNING! This method violates unsafe pointer-conversion rules. You MUST make sure that (b) stays alive while the resulting ByteString is in use.
func WrapOf ¶
func WrapOf(v interface{}, mt MMapType) longbits.ByteString
func WrapSlice ¶
func WrapSlice(v interface{}) longbits.ByteString
WARNING! The given struct MUST be immutable. Expects struct ptr. WARNING! This method violates unsafe pointer-conversion rules. You MUST make sure that (v) stays alive while the resulting ByteString is in use.
func WrapSliceOf ¶
func WrapSliceOf(v interface{}, mt MMapSliceType) longbits.ByteString
func WrapStruct ¶
func WrapStruct(v interface{}) longbits.ByteString
Expects struct ptr. WARNING! This method violates unsafe pointer-conversion rules. You MUST make sure that (v) stays alive while the resulting ByteString is in use.
func WrapValueStruct ¶
func WrapValueStruct(v interface{}) longbits.ByteString
Expects struct value. Reuses the value. WARNING! Further unwraps MUST NOT modify the content. WARNING! This method violates unsafe pointer-conversion rules. You MUST make sure that (v) stays alive while the resulting ByteString is in use.
Types ¶
type KeepAliveList ¶
type KeepAliveList struct {
// contains filtered or unexported fields
}
func (*KeepAliveList) Keep ¶
func (p *KeepAliveList) Keep(v interface{})
func (*KeepAliveList) KeepDataOf ¶
func (p *KeepAliveList) KeepDataOf(v longbits.ByteString)
func (*KeepAliveList) KeepDataOfBytes ¶
func (p *KeepAliveList) KeepDataOfBytes(v []byte)
func (*KeepAliveList) Reset ¶
func (p *KeepAliveList) Reset()
type MMapSliceType ¶
type MMapSliceType struct {
// contains filtered or unexported fields
}
func MustMMapSliceType ¶
func MustMMapSliceType(t reflect.Type, mustBeIndependent bool) MMapSliceType
func NewMMapSliceType ¶
func NewMMapSliceType(t reflect.Type) (MMapSliceType, bool)
func (MMapSliceType) Elem ¶
func (v MMapSliceType) Elem() MMapType
func (MMapSliceType) ElemReflectType ¶
func (v MMapSliceType) ElemReflectType() reflect.Type
func (MMapSliceType) IsZero ¶
func (v MMapSliceType) IsZero() bool
func (MMapSliceType) MemoryModelIndependent ¶
func (v MMapSliceType) MemoryModelIndependent() bool
func (MMapSliceType) ReflectType ¶
func (v MMapSliceType) ReflectType() reflect.Type
func (MMapSliceType) Unwrap ¶
func (v MMapSliceType) Unwrap(s longbits.ByteString) interface{}
type MMapType ¶
type MMapType struct {
// contains filtered or unexported fields
}
func (MMapType) MemoryModelIndependent ¶
func (MMapType) ReflectType ¶
func (MMapType) SliceOf ¶
func (v MMapType) SliceOf() MMapSliceType
func (MMapType) Unwrap ¶
func (v MMapType) Unwrap(s longbits.ByteString) interface{}
type MemoryMapModel ¶
type MemoryMapModel uint8
const ( MemoryMapIncompatible MemoryMapModel = iota MemoryModelDepended MemoryModelIndependent )
func MemoryModelDependencyOf ¶
func MemoryModelDependencyOf(t reflect.Type) MemoryMapModel
type MemoryModelSupported ¶
type MemoryModelSupported uint8
const ( LittleEndianSupported MemoryModelSupported BigEndianSupported EndianIndependent // LittleEndianSupported | BigEndianSupported )
type Unwrapper ¶
type Unwrapper interface { Unwrap(longbits.ByteString) interface{} MemoryModelIndependent() bool }