summaryrefslogtreecommitdiff
path: root/libgo/go/runtime/rdebug.go
blob: 76535a905acc1ca8a32c9ffc4c6edb7c578ae78c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package runtime

import _ "unsafe" // for go:linkname

// Define maxstacksize here for gccgo. For gc it is defined in
// stack.go, but gccgo doesn't use that file. Or, for that matter,
// maxstacksize.
var maxstacksize uintptr = 1 << 20 // enough until runtime.main sets it for real

//go:linkname setMaxStack runtime_debug.setMaxStack
func setMaxStack(in int) (out int) {
	out = int(maxstacksize)
	maxstacksize = uintptr(in)
	return out
}

//go:linkname setPanicOnFault runtime_debug.setPanicOnFault
func setPanicOnFault(new bool) (old bool) {
	_g_ := getg()
	old = _g_.paniconfault
	_g_.paniconfault = new
	return old
}