Documentation
¶
Index ¶
- Constants
- func ConvertOne[TFrom, TTo any](from TFrom) (TTo, error)
- func ConvertSlice[TFrom, TTo any](from []TFrom) ([]TTo, error)
- func ConvertUnsafePointer[T any](p unsafe.Pointer) T
- func CopyString(s string) string
- func CopyUnsafe(dst []byte, src []byte) int
- func Equal(a, b []byte, length uintptr) bool
- func GetItem[T any](slice []T, idx int) T
- func GetItemWithoutCheck[T any](slice []T, idx int) T
- func GetPrivateField[T any, V any](ptr *T, fieldName string) *V
- func Inspect(v interface{}) (reflect.Type, unsafe.Pointer)
- func IsEqual[T any](v1, v2 T) bool
- func IsNil(v any) bool
- func Log2(i uintptr) (n uintptr)
- func MakeNoZero(l int) []byte
- func MakeNoZeroCap(l int, c int) []byte
- func MakeNoZeroCapString(l int, c int) []string
- func MakeNoZeroString(l int) []string
- func MakeSlice[T any](len, cap int) []T
- func MakeZero[T any](l int) []T
- func MakeZeroCap[T any](l int, c int) []T
- func Malloc[T any](t T) *T
- func MallocSlice[T any](len, cap int) []T
- func MulUintptr(a, b uintptr) (uintptr, bool)
- func MustConvertOne[TFrom, TTo any](from TFrom) TTo
- func NextPowerOfTwo(i uintptr) uintptr
- func Noescape(up unsafe.Pointer) unsafe.Pointer
- func Pointer(v interface{}) unsafe.Pointer
- func String(b []byte) string
- func StringToBytes(s string) []byte
- func Swap[T any](a, b *T)
- func UnsafePointer[T any](b T) unsafe.Pointer
- type AtomicCounter
- type CacheLinePadding
- type ErrorSizeUnmatch
- type Iface
- type MutableString
- func (m *MutableString) Append(data []byte)
- func (m *MutableString) AppendByte(c byte)
- func (m *MutableString) AppendString(s string)
- func (m *MutableString) Clear()
- func (m *MutableString) Equals(other string) bool
- func (m *MutableString) Get(i int) byte
- func (m *MutableString) IsEmpty() bool
- func (m *MutableString) Len() int
- func (m *MutableString) SetString(s string)
- func (m *MutableString) String() string
- func (m *MutableString) StringNoZero() string
- func (m *MutableString) ToLower()
- func (m *MutableString) ToUpper()
- func (m *MutableString) Trim()
- type Slice_t
- type StringBuffer
- func (b *StringBuffer) Bytes() []byte
- func (b *StringBuffer) Cap() int
- func (b *StringBuffer) Grow(n int)
- func (b *StringBuffer) Len() int
- func (b *StringBuffer) Reset()
- func (b *StringBuffer) String() string
- func (b *StringBuffer) Write(p []byte) (int, error)
- func (b *StringBuffer) WriteByte(c byte) error
- func (b *StringBuffer) WriteRune(r rune) (int, error)
- func (b *StringBuffer) WriteString(s string) (int, error)
- type String_t
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func ConvertOne ¶
func ConvertSlice ¶
func ConvertUnsafePointer ¶
func CopyString ¶
func CopyUnsafe ¶
constants in make for standart copy is more faster,but if no constant we can use CopyUnsafe() make([]byte, len(src)) not constant make([]byte, 0) constant
func GetItemWithoutCheck ¶
func GetPrivateField ¶
func IsEqual ¶
IsEqual checks if two variables point to the same memory location.
It uses unsafe.Pointer to get the memory address of the variables. The equality check is performed by comparing the memory addresses.
Parameters: - v1: The first variable. - v2: The second variable.
Returns: - bool: True if the variables point to the same memory location, false otherwise.
func MakeNoZero ¶
func MakeNoZeroCap ¶
func MakeNoZeroCapString ¶
func MakeNoZeroString ¶
func MakeZeroCap ¶
func MallocSlice ¶
func MulUintptr ¶
func MustConvertOne ¶
func MustConvertOne[TFrom, TTo any](from TFrom) TTo
func NextPowerOfTwo ¶
func StringToBytes ¶
func UnsafePointer ¶
Types ¶
type AtomicCounter ¶
type AtomicCounter struct {
// contains filtered or unexported fields
}
func (*AtomicCounter) Get ¶
func (a *AtomicCounter) Get() int32
func (*AtomicCounter) Increment ¶
func (a *AtomicCounter) Increment(int)
type CacheLinePadding ¶
type CacheLinePadding struct {
// contains filtered or unexported fields
}
type ErrorSizeUnmatch ¶
type ErrorSizeUnmatch struct {
// contains filtered or unexported fields
}
func (*ErrorSizeUnmatch) Error ¶
func (err *ErrorSizeUnmatch) Error() string
type MutableString ¶
type MutableString []byte
func (*MutableString) Append ¶
func (m *MutableString) Append(data []byte)
func (*MutableString) AppendByte ¶
func (m *MutableString) AppendByte(c byte)
func (*MutableString) AppendString ¶
func (m *MutableString) AppendString(s string)
func (*MutableString) Clear ¶
func (m *MutableString) Clear()
func (*MutableString) Equals ¶
func (m *MutableString) Equals(other string) bool
func (*MutableString) Get ¶
func (m *MutableString) Get(i int) byte
func (*MutableString) IsEmpty ¶
func (m *MutableString) IsEmpty() bool
func (*MutableString) Len ¶
func (m *MutableString) Len() int
func (*MutableString) SetString ¶
func (m *MutableString) SetString(s string)
func (*MutableString) String ¶
func (m *MutableString) String() string
func (*MutableString) StringNoZero ¶
func (m *MutableString) StringNoZero() string
func (*MutableString) ToLower ¶
func (m *MutableString) ToLower()
func (*MutableString) ToUpper ¶
func (m *MutableString) ToUpper()
func (*MutableString) Trim ¶
func (m *MutableString) Trim()
type StringBuffer ¶
type StringBuffer struct {
// contains filtered or unexported fields
}
func NewStringBuffer ¶
func NewStringBuffer(cap int) *StringBuffer
func (*StringBuffer) Bytes ¶
func (b *StringBuffer) Bytes() []byte
func (*StringBuffer) Cap ¶
func (b *StringBuffer) Cap() int
func (*StringBuffer) Grow ¶
func (b *StringBuffer) Grow(n int)
func (*StringBuffer) Len ¶
func (b *StringBuffer) Len() int
func (*StringBuffer) Reset ¶
func (b *StringBuffer) Reset()
func (*StringBuffer) String ¶
func (b *StringBuffer) String() string
func (*StringBuffer) WriteByte ¶
func (b *StringBuffer) WriteByte(c byte) error
func (*StringBuffer) WriteString ¶
func (b *StringBuffer) WriteString(s string) (int, error)
Click to show internal directories.
Click to hide internal directories.