2014-08-24 21:27:00 -06:00
|
|
|
// 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
|
|
|
|
|
2015-10-16 01:19:14 -06:00
|
|
|
import _ "unsafe" // for go:linkname
|
|
|
|
|
|
|
|
//go:linkname setMaxStack runtime/debug.setMaxStack
|
2014-08-24 21:27:00 -06:00
|
|
|
func setMaxStack(in int) (out int) {
|
|
|
|
out = int(maxstacksize)
|
cmd/cc, runtime: preserve C runtime type names in generated Go
uintptr or uint64 in the runtime C were turning into uint in the Go,
bool was turning into uint8, and so on. Fix that.
Also delete Go wrappers for C functions.
The C functions can be called directly now
(but still eventually need to be converted to Go).
LGTM=bradfitz, minux, iant
R=golang-codereviews, bradfitz, iant, minux
CC=golang-codereviews, khr, r
https://golang.org/cl/138740043
2014-08-27 19:59:49 -06:00
|
|
|
maxstacksize = uintptr(in)
|
2014-08-24 21:27:00 -06:00
|
|
|
return out
|
|
|
|
}
|
|
|
|
|
2015-10-16 01:19:14 -06:00
|
|
|
//go:linkname setPanicOnFault runtime/debug.setPanicOnFault
|
cmd/cc, runtime: preserve C runtime type names in generated Go
uintptr or uint64 in the runtime C were turning into uint in the Go,
bool was turning into uint8, and so on. Fix that.
Also delete Go wrappers for C functions.
The C functions can be called directly now
(but still eventually need to be converted to Go).
LGTM=bradfitz, minux, iant
R=golang-codereviews, bradfitz, iant, minux
CC=golang-codereviews, khr, r
https://golang.org/cl/138740043
2014-08-27 19:59:49 -06:00
|
|
|
func setPanicOnFault(new bool) (old bool) {
|
2014-08-24 21:27:00 -06:00
|
|
|
mp := acquirem()
|
cmd/cc, runtime: preserve C runtime type names in generated Go
uintptr or uint64 in the runtime C were turning into uint in the Go,
bool was turning into uint8, and so on. Fix that.
Also delete Go wrappers for C functions.
The C functions can be called directly now
(but still eventually need to be converted to Go).
LGTM=bradfitz, minux, iant
R=golang-codereviews, bradfitz, iant, minux
CC=golang-codereviews, khr, r
https://golang.org/cl/138740043
2014-08-27 19:59:49 -06:00
|
|
|
old = mp.curg.paniconfault
|
2014-08-24 21:27:00 -06:00
|
|
|
mp.curg.paniconfault = new
|
|
|
|
releasem(mp)
|
|
|
|
return old
|
|
|
|
}
|