github.com/aloncn/graphics-go@v0.0.1/src/runtime/rdebug.go (about)

     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  
     5  package runtime
     6  
     7  import _ "unsafe" // for go:linkname
     8  
     9  //go:linkname setMaxStack runtime/debug.setMaxStack
    10  func setMaxStack(in int) (out int) {
    11  	out = int(maxstacksize)
    12  	maxstacksize = uintptr(in)
    13  	return out
    14  }
    15  
    16  //go:linkname setPanicOnFault runtime/debug.setPanicOnFault
    17  func setPanicOnFault(new bool) (old bool) {
    18  	mp := acquirem()
    19  	old = mp.curg.paniconfault
    20  	mp.curg.paniconfault = new
    21  	releasem(mp)
    22  	return old
    23  }