1 // Copyright 2023 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package abi 6 7 const ( 8 // StackNosplitBase is the base maximum number of bytes that a chain of 9 // NOSPLIT functions can use. 10 // 11 // This value must be multiplied by the stack guard multiplier, so do not 12 // use it directly. See runtime/stack.go:stackNosplit and 13 // cmd/internal/objabi/stack.go:StackNosplit. 14 StackNosplitBase = 800 15 16 // We have three different sequences for stack bounds checks, depending on 17 // whether the stack frame of a function is small, big, or huge. 18 19 // After a stack split check the SP is allowed to be StackSmall bytes below 20 // the stack guard. 21 // 22 // Functions that need frames <= StackSmall can perform the stack check 23 // using a single comparison directly between the stack guard and the SP 24 // because we ensure that StackSmall bytes of stack space are available 25 // beyond the stack guard. 26 StackSmall = 128 27 28 // Functions that need frames <= StackBig can assume that neither 29 // SP-framesize nor stackGuard-StackSmall will underflow, and thus use a 30 // more efficient check. In order to ensure this, StackBig must be <= the 31 // size of the unmapped space at zero. 32 StackBig = 4096 33 ) 34