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
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
func setGCPercent(in int32) (out int32) {
|
|
|
|
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
|
|
|
mp.scalararg[0] = uintptr(int(in))
|
2014-09-03 09:35:22 -06:00
|
|
|
onM(setgcpercent_m)
|
2014-08-24 21:27:00 -06:00
|
|
|
out = int32(int(mp.scalararg[0]))
|
|
|
|
releasem(mp)
|
|
|
|
return out
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
func setMaxThreads(in int) (out int) {
|
|
|
|
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
|
|
|
mp.scalararg[0] = uintptr(in)
|
2014-09-03 09:35:22 -06:00
|
|
|
onM(setmaxthreads_m)
|
2014-08-24 21:27:00 -06:00
|
|
|
out = int(mp.scalararg[0])
|
|
|
|
releasem(mp)
|
|
|
|
return out
|
|
|
|
}
|