util

package
v0.0.0-...-f6902ab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2023 License: Apache-2.0 Imports: 2 Imported by: 25

Documentation

Index

Constants

View Source
const (
	// CacheLineLength is a constant for the size of a CPU cache line
	CacheLineLength int32 = 64

	// SizeOfInt32 is a constant for the size of int32. Ha. Just for Clarity
	SizeOfInt32 int32 = int32(unsafe.Sizeof(i32))

	// SizeOfInt64 is a constant for the size of int64
	SizeOfInt64 int32 = int32(unsafe.Sizeof(i64))
)

Variables

This section is empty.

Functions

func AlignInt32

func AlignInt32(value, alignment int32) int32

AlignInt32 will return a number rounded up to the alignment boundary

func FastMod3

func FastMod3(value uint64) int32

FastMod3 is HD recipe for faster division by 3 for 32 bit integers

func IsPowerOfTwo

func IsPowerOfTwo(value int64) bool

IsPowerOfTwo checks that the argument number is a power of two

func MemPrint

func MemPrint(ptr uintptr, len int) string

func Memcpy

func Memcpy(dest uintptr, src uintptr, length int32)

Memcpy will copy length bytes from pointer src to dest

func NumberOfTrailingZeroes

func NumberOfTrailingZeroes(value uint32) uint8

NumberOfTrailingZeroes is HD recipe for determining the number of leading zeros on 32 bit integer

func Print

func Print(bytes []byte)

func SemanticVersionCompose

func SemanticVersionCompose(major uint8, minor uint8, patch uint8) uint32

func SemanticVersionMajor

func SemanticVersionMajor(version uint32) uint8

func SemanticVersionMinor

func SemanticVersionMinor(version uint32) uint8

func SemanticVersionPatch

func SemanticVersionPatch(version uint32) uint8

func SemanticVersionToString

func SemanticVersionToString(version uint32) string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL