diff options
| author | Austin Clements <austin@google.com> | 2023-04-20 16:09:48 +0000 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2023-04-20 16:19:35 +0000 |
| commit | d11ff3f08155b7614485d9b555e97f7a9555ede5 (patch) | |
| tree | 6dbf61a63363f0ab8deb5074c550e10ff1666036 /src/cmd/internal/objabi/stack.go | |
| parent | df777cfa15caccbec74b9f72d19af317e2870138 (diff) | |
| download | go-d11ff3f08155b7614485d9b555e97f7a9555ede5.tar.xz | |
Revert "runtime, cmd: rationalize StackLimit and StackGuard"
This reverts commit CL 486380.
Submitted out of order and breaks bootstrap.
Change-Id: I67bd225094b5c9713b97f70feba04d2c99b7da76
Reviewed-on: https://go-review.googlesource.com/c/go/+/486916
Reviewed-by: David Chase <drchase@google.com>
TryBot-Bypass: Austin Clements <austin@google.com>
Diffstat (limited to 'src/cmd/internal/objabi/stack.go')
| -rw-r--r-- | src/cmd/internal/objabi/stack.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/cmd/internal/objabi/stack.go b/src/cmd/internal/objabi/stack.go index 7c7ff4e058..5a2f641a75 100644 --- a/src/cmd/internal/objabi/stack.go +++ b/src/cmd/internal/objabi/stack.go @@ -9,9 +9,18 @@ import ( "internal/buildcfg" ) -func StackNosplit(race bool) int { - // This arithmetic must match that in runtime/stack.go:stackNosplit. - return abi.StackNosplitBase * stackGuardMultiplier(race) +// For the linkers. Must match Go definitions. + +const ( + STACKSYSTEM = 0 + StackSystem = STACKSYSTEM +) + +func StackLimit(race bool) int { + // This arithmetic must match that in runtime/stack.go:{_StackGuard,_StackLimit}. + stackGuard := 928*stackGuardMultiplier(race) + StackSystem + stackLimit := stackGuard - StackSystem - abi.StackSmall + return stackLimit } // stackGuardMultiplier returns a multiplier to apply to the default |
