memtest

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package memtest provides test helpers shared by the memory-go packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Local

func Local(t testing.TB) *memory.Local

Local returns an allocator that fails t if anything allocated from it is still live when t ends, and closes it.

func ReportRSS added in v0.4.0

func ReportRSS(b *testing.B, baseline int64)

ReportRSS reports how many bytes of resident memory the process gained since baseline, from Resident, as a benchmark metric. It reports nothing where Resident is unavailable.

func Resident added in v0.4.0

func Resident() int64

Resident returns the process's resident memory in bytes, or 0 where that is unavailable.

func Seed

func Seed(seed uint64, n int) []byte

Seed returns n reproducible pseudo-random bytes for a fuzz seed corpus.

Types

type Ops

type Ops struct {
	// contains filtered or unexported fields
}

Ops decodes a fuzz input into a stream of operations. Reads past the end yield zeros.

func NewOps

func NewOps(data []byte) *Ops

NewOps returns an Ops reading data.

func (*Ops) Int

func (o *Ops) Int(n int) int

Int returns a value in [0, n). n must be in (0, 65536].

func (*Ops) More

func (o *Ops) More() bool

More reports whether unread input remains.

func (*Ops) Uint64

func (o *Ops) Uint64() uint64

Uint64 returns the next eight bytes as a value.

Jump to

Keyboard shortcuts

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