github.com/timandy/routine@v1.1.4/g/g.go (about)

     1  // Copyright 2021-2024 TimAndy. All rights reserved.
     2  // Licensed under the Apache-2.0 license that can be found in the LICENSE file.
     3  
     4  package g
     5  
     6  import (
     7  	"reflect"
     8  	"unsafe"
     9  )
    10  
    11  // getgp returns the pointer to the current runtime.g.
    12  //
    13  //go:nosplit
    14  func getgp() unsafe.Pointer
    15  
    16  // getgt returns the type of runtime.g.
    17  //
    18  //go:nosplit
    19  func getgt() reflect.Type {
    20  	return typeByString("runtime.g")
    21  }