rdebug.goc 612 B

123456789101112131415161718192021222324252627
  1. // Copyright 2013 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.
  4. package runtime_debug
  5. #include "runtime.h"
  6. #include "arch.h"
  7. #include "malloc.h"
  8. func setMaxStack(in int) (out int) {
  9. out = runtime_maxstacksize;
  10. runtime_maxstacksize = in;
  11. }
  12. func setGCPercent(in int) (out int) {
  13. out = runtime_setgcpercent(in);
  14. }
  15. func setMaxThreads(in int) (out int) {
  16. out = runtime_setmaxthreads(in);
  17. }
  18. func SetPanicOnFault(enabled bool) (old bool) {
  19. old = runtime_g()->paniconfault;
  20. runtime_g()->paniconfault = enabled;
  21. }