unsafe

package
v0.12.2-0...-0823e43 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadMarker

func ReadMarker(r io.Reader) error

ReadMarker reads the raw memory representation of a fixed marker from the reader. This is used to ensure that the dump was written on the same architecture.

func ReadSlice

func ReadSlice[S ~[]E, E any](r io.Reader, maxElements ...int) (s S, read int, err error)

ReadSlice reads a slice of arbitrary objects from the reader, written by WriteSlice.

func WriteMarker

func WriteMarker(w io.Writer) error

WriteMarker writes the raw memory representation of a fixed marker to the writer. This is used to ensure that the dump was written on the same architecture.

func WriteSlice

func WriteSlice[S ~[]E, E any](w io.Writer, s S) error

WriteSlice writes a slice of arbitrary objects to the writer. Use with caution, as it writes the raw memory representation of the slice; In particular you do not want to use this with slices that contain pointers. This architecture dependent and will not work across different architectures (e.g. 32 vs 64 bit, big endian vs little endian).

Types

This section is empty.

Jump to

Keyboard shortcuts

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