github.com/goplus/llgo@v0.8.3/internal/runtime/runtime2.go (about)

     1  // Copyright 2009 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 (
     8  	"unsafe"
     9  )
    10  
    11  type iface struct {
    12  	tab  *itab
    13  	data unsafe.Pointer
    14  }
    15  
    16  /*
    17  type eface struct {
    18  	_type *_type
    19  	data  unsafe.Pointer
    20  }
    21  
    22  func efaceOf(ep *any) *eface {
    23  	return (*eface)(unsafe.Pointer(ep))
    24  }
    25  */
    26  
    27  // layout of Itab known to compilers
    28  // allocated in non-garbage-collected memory
    29  // Needs to be in sync with
    30  // ../cmd/compile/internal/reflectdata/reflect.go:/^func.WriteTabs.
    31  type itab struct {
    32  	inter *interfacetype
    33  	_type *_type
    34  	hash  uint32 // copy of _type.hash. Used for type switches.
    35  	_     [4]byte
    36  	fun   [1]uintptr // variable sized. fun[0]==0 means _type does not implement inter.
    37  }