stack

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package stack provides low-level access to current stack space

Index

Constants

View Source
const (
	// AIX requires a larger stack for syscalls.
	// The race build also needs more stack. See issue 54291.
	//
	// This arithmetic must match that in
	// $GOROOT/cmd/internal/objabi/stack.go:stackGuardMultiplier.
	StackGuardMultiplier = 1 + os.IsAix + race.IsRace

	// StackSystem is a number of additional bytes to add
	// to each stack below the usual guard area for OS-specific
	// purposes like signal handling. Used on Windows, Plan 9,
	// and iOS because they do not use a separate stack.
	StackSystem = os.IsWindows*512*arch.PtrSize +
		os.IsPlan9*512 +
		os.IsIos*arch.IsArm64*1024

	// StackNosplit is the maximum number of bytes that a chain of NOSPLIT
	// functions can use.
	//
	// This arithmetic must match that in cmd/internal/objabi/stack.go:StackNosplit.
	StackNosplit = abi.StackNosplitBase * StackGuardMultiplier

	// The stack guard is a pointer this many bytes above the
	// bottom of the stack.
	//
	// The guard leaves enough room for a stackNosplit chain of NOSPLIT calls
	// plus one stackSmall frame plus stackSystem bytes for the OS.
	//
	// This arithmetic must match that in cmd/internal/objabi/stack.go:StackLimit.
	StackGuard = StackNosplit + StackSystem + abi.StackSmall
)

Variables

This section is empty.

Functions

func GetSP

func GetSP() uintptr

GetSP returns the value of the stack pointer register on calling.

func SetSP

func SetSP(sp uintptr)

Types

type Frame

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

A Frame holds information about a single stack frame.

see $GOROOT/src/runtime/symtab.go#stkframe

type Stack

type Stack = stdgo.Stack

Jump to

Keyboard shortcuts

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