1 // Copyright 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
7 import _
"unsafe" // for go:linkname
9 // Define maxstacksize here for gccgo. For gc it is defined in
10 // stack.go, but gccgo doesn't use that file. Or, for that matter,
12 var maxstacksize
uintptr = 1 << 20 // enough until runtime.main sets it for real
14 //go:linkname setMaxStack runtime_debug.setMaxStack
15 func setMaxStack(in
int) (out
int) {
16 out
= int(maxstacksize
)
17 maxstacksize
= uintptr(in
)
21 //go:linkname setPanicOnFault runtime_debug.setPanicOnFault
22 func setPanicOnFault(new bool) (old
bool) {
24 old
= _g_
.paniconfault
25 _g_
.paniconfault
= new