llgo/ssa: AfterInit/SliceLit/InterfaceData, unsafe.Slice; ssa/abi: Basic/Struct
This commit is contained in:
@@ -8,21 +8,20 @@ import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
type iface struct {
|
||||
tab *itab
|
||||
data unsafe.Pointer
|
||||
}
|
||||
|
||||
/*
|
||||
type eface struct {
|
||||
_type *_type
|
||||
data unsafe.Pointer
|
||||
}
|
||||
|
||||
/*
|
||||
func efaceOf(ep *any) *eface {
|
||||
return (*eface)(unsafe.Pointer(ep))
|
||||
}
|
||||
*/
|
||||
|
||||
type iface struct {
|
||||
tab *itab
|
||||
data unsafe.Pointer
|
||||
}
|
||||
|
||||
// layout of Itab known to compilers
|
||||
// allocated in non-garbage-collected memory
|
||||
@@ -35,3 +34,11 @@ type itab struct {
|
||||
_ [4]byte
|
||||
fun [1]uintptr // variable sized. fun[0]==0 means _type does not implement inter.
|
||||
}
|
||||
|
||||
func MakeInterface(inter *InterfaceType, typ *Type, data unsafe.Pointer) Interface {
|
||||
tab := &itab{inter: inter, _type: typ, hash: 0, fun: [1]uintptr{0}}
|
||||
return Interface{
|
||||
tab: tab, data: data,
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user