rdebug.go 777 B

1234567891011121314151617181920212223242526272829303132333435363738
  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.
  4. package runtime
  5. func setMaxStack(in int) (out int) {
  6. out = int(maxstacksize)
  7. maxstacksize = uintptr(in)
  8. return out
  9. }
  10. func setGCPercent(in int32) (out int32) {
  11. mp := acquirem()
  12. mp.scalararg[0] = uintptr(int(in))
  13. onM(setgcpercent_m)
  14. out = int32(int(mp.scalararg[0]))
  15. releasem(mp)
  16. return out
  17. }
  18. func setPanicOnFault(new bool) (old bool) {
  19. mp := acquirem()
  20. old = mp.curg.paniconfault
  21. mp.curg.paniconfault = new
  22. releasem(mp)
  23. return old
  24. }
  25. func setMaxThreads(in int) (out int) {
  26. mp := acquirem()
  27. mp.scalararg[0] = uintptr(in)
  28. onM(setmaxthreads_m)
  29. out = int(mp.scalararg[0])
  30. releasem(mp)
  31. return out
  32. }