diff options
| author | Akshat Kumar <seed@mail.nanosouffle.net> | 2013-01-30 02:53:56 -0800 |
|---|---|---|
| committer | Anthony Martin <ality@pbrane.org> | 2013-01-30 02:53:56 -0800 |
| commit | c74f3c457613638311e3cb2a57a9fca2df849e7a (patch) | |
| tree | d9dee8a405a309fc25b98c4ece130ac0de1513a4 /src/pkg/runtime/stack.h | |
| parent | c5da34eabeb35dea137bb1a217173fc29bf44ca1 (diff) | |
| download | go-c74f3c457613638311e3cb2a57a9fca2df849e7a.tar.xz | |
runtime: add support for panic/recover in Plan 9 note handler
This change also resolves some issues with note handling: we now make
sure that there is enough room at the bottom of every goroutine to
execute the note handler, and the `exitstatus' is no longer a global
entity, which resolves some race conditions.
R=rminnich, npe, rsc, ality
CC=golang-dev
https://golang.org/cl/6569068
Diffstat (limited to 'src/pkg/runtime/stack.h')
| -rw-r--r-- | src/pkg/runtime/stack.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/pkg/runtime/stack.h b/src/pkg/runtime/stack.h index d42385d6cb..06b0c568c2 100644 --- a/src/pkg/runtime/stack.h +++ b/src/pkg/runtime/stack.h @@ -55,13 +55,19 @@ 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. + // purposes like signal handling. Used on Windows and on + // Plan 9 because they do not use a separate stack. #ifdef GOOS_windows StackSystem = 512 * sizeof(uintptr), #else +#ifdef GOOS_plan9 + // The size of the note handler frame varies among architectures, + // but 512 bytes should be enough for every implementation. + StackSystem = 512, +#else StackSystem = 0, -#endif +#endif // Plan 9 +#endif // Windows // The amount of extra stack to allocate beyond the size // needed for the single frame that triggered the split. |
