ptr

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Facilitating memory & pointer operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmpNBytes

func CmpNBytes(n uintptr, p1, p2 unsafe.Pointer) bool

Returns true if both bytes arrays of size `n`, pointed by p1 & p2 are equal.

Alternatives:

Function CmpBitsAs[[n]uint8](p1,p2) from https://github.com/Siiir/ptr v1.0.0, is a safe & more compile-time alternative for this unsafe one.

func Offset

func Offset[T any, I constraints.Integer](ptr *T, offset I) *T

Uses `unsafe.Pointer` & `unsafe.Add` to return pointer `ptr` offset with `offset` .

Types

This section is empty.

Jump to

Keyboard shortcuts

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