]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/gc: move large stack variables to heap
authorRuss Cox <rsc@golang.org>
Thu, 8 Aug 2013 17:46:30 +0000 (13:46 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 8 Aug 2013 17:46:30 +0000 (13:46 -0400)
commit1f4d58ad5d6cdb03cd4f9d8062a711db9fe137bd
tree091c2f9d429430a8027d73f0d65f43ff5c225ac0
parentbdbd5418f4c2dc87fa18e6b39e4ead21c6d87bbe
cmd/gc: move large stack variables to heap

Individual variables bigger than 10 MB are now
moved to the heap, as if they had escaped on
their own.

This avoids ridiculous stacks for programs that
do things like
        x := [1<<30]byte{}
        ... use x ...

If 10 MB is too small, we can raise the limit.

Fixes #6077.

R=ken2
CC=golang-dev
https://golang.org/cl/12650045
src/cmd/gc/go.h
src/cmd/gc/lex.c
src/cmd/gc/pgen.c
test/escape5.go
test/fixedbugs/bug385_64.go