mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: report "out of memory" in efence mode
Currently processes crash with obscure message. Say that it's "out of memory". LGTM=rsc R=golang-codereviews CC=golang-codereviews, khr, rsc https://golang.org/cl/75820045
This commit is contained in:
parent
0da73b9f07
commit
d8e6881166
1 changed files with 6 additions and 2 deletions
|
|
@ -102,8 +102,12 @@ runtime·stackalloc(G *gp, uint32 n)
|
|||
runtime·printf("stackalloc %d\n", n);
|
||||
|
||||
gp->stacksize += n;
|
||||
if(runtime·debug.efence || StackFromSystem)
|
||||
return runtime·SysAlloc(ROUND(n, PageSize), &mstats.stacks_sys);
|
||||
if(runtime·debug.efence || StackFromSystem) {
|
||||
v = runtime·SysAlloc(ROUND(n, PageSize), &mstats.stacks_sys);
|
||||
if(v == nil)
|
||||
runtime·throw("out of memory (stackalloc)");
|
||||
return v;
|
||||
}
|
||||
|
||||
// Minimum-sized stacks are allocated with a fixed-size free-list allocator,
|
||||
// but if we need a stack of a bigger size, we fall back on malloc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue