apple

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 1 Imported by: ? 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PosLoopDetector

type PosLoopDetector[T mathx.Integer] []T

PosLoopDetector is used for detecting loops when writing decoders, and can short-circuit infinite recursion that can cause stack overflows.

func (*PosLoopDetector[T]) Pop

func (pld *PosLoopDetector[T]) Pop()

Pop removes the most recently added offset from the stack.

func (*PosLoopDetector[T]) Push

func (pld *PosLoopDetector[T]) Push(offset T, detect func())

Push adds the current offset to the stack and executes the supplied detection function

func (*PosLoopDetector[T]) PushAndPop

func (pld *PosLoopDetector[T]) PushAndPop(offset T, detect func()) func()

PushAndPop adds the current offset to the stack, executes the supplied detection function, and returns the Pop method. A good usage of this is to pair this method call with a defer statement.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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