aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/runtime.h
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2013-08-15 22:34:06 -0400
committerRuss Cox <rsc@golang.org>2013-08-15 22:34:06 -0400
commit757e0de89f80e89626cc8b7d6e670c0e5ea7f192 (patch)
tree42b7768f368edc26299146007ebf0777618fa677 /src/pkg/runtime/runtime.h
parent205329aaf2ec9aff13c4052f6dfa552e65760ea9 (diff)
downloadgo-757e0de89f80e89626cc8b7d6e670c0e5ea7f192.tar.xz
runtime: impose stack size limit
The goal is to stop only those programs that would keep going and run the machine out of memory, but before they do that. 1 GB on 64-bit, 250 MB on 32-bit. That seems implausibly large, and it can be adjusted. Fixes #2556. Fixes #4494. Fixes #5173. R=khr, r, dvyukov CC=golang-dev https://golang.org/cl/12541052
Diffstat (limited to 'src/pkg/runtime/runtime.h')
-rw-r--r--src/pkg/runtime/runtime.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h
index b80e2ad41a..b87e64dfa1 100644
--- a/src/pkg/runtime/runtime.h
+++ b/src/pkg/runtime/runtime.h
@@ -259,6 +259,7 @@ struct G
uintptr syscallguard; // if status==Gsyscall, syscallguard = stackguard to use during gc
uintptr stackguard; // same as stackguard0, but not set to StackPreempt
uintptr stack0;
+ uintptr stacksize;
G* alllink; // on allg
void* param; // passed parameter on wakeup
int16 status;
@@ -713,6 +714,7 @@ extern uint32 runtime·Hchansize;
extern uint32 runtime·cpuid_ecx;
extern uint32 runtime·cpuid_edx;
extern DebugVars runtime·debug;
+extern uintptr runtime·maxstacksize;
/*
* common functions and data