diff options
| author | Alexey Borzenkov <snaury@gmail.com> | 2011-05-16 16:57:49 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2011-05-16 16:57:49 -0400 |
| commit | b701cf333290a2b7ebc71d745c0af16355c66163 (patch) | |
| tree | ae45da243e2941720a1389cf26e81261e8ec99f0 /src/pkg/runtime/stack.h | |
| parent | e69b9ddd4219b8d9d4d1b26cdd31875bdac9c0c7 (diff) | |
| download | go-b701cf333290a2b7ebc71d745c0af16355c66163.tar.xz | |
runtime: make StackSystem part of StackGuard
Fixes #1779
R=rsc
CC=golang-dev
https://golang.org/cl/4543052
Diffstat (limited to 'src/pkg/runtime/stack.h')
| -rw-r--r-- | src/pkg/runtime/stack.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/pkg/runtime/stack.h b/src/pkg/runtime/stack.h index ebf0462b56..2b6b0e3876 100644 --- a/src/pkg/runtime/stack.h +++ b/src/pkg/runtime/stack.h @@ -53,6 +53,16 @@ functions to make sure that this limit cannot be violated. */ enum { + // 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 because + // it does not use a separate stack. +#ifdef __WINDOWS__ + StackSystem = 2048, +#else + StackSystem = 0, +#endif + // The amount of extra stack to allocate beyond the size // needed for the single frame that triggered the split. StackExtra = 1024, @@ -73,7 +83,7 @@ enum { // The stack guard is a pointer this many bytes above the // bottom of the stack. - StackGuard = 256, + StackGuard = 256 + StackSystem, // After a stack split check the SP is allowed to be this // many bytes below the stack guard. This saves an instruction @@ -82,5 +92,5 @@ enum { // The maximum number of bytes that a chain of NOSPLIT // functions can use. - StackLimit = StackGuard - StackSmall, + StackLimit = StackGuard - StackSystem - StackSmall, }; |
