runtime: init abi.Type.PtrBytes

This commit is contained in:
visualfc
2024-07-15 21:23:47 +08:00
parent 9f1100b967
commit 9e6aed0760
2 changed files with 19 additions and 2 deletions

View File

@@ -190,7 +190,8 @@ func doInitNamed(ret *Type, pkgPath, fullName string, underlying *Type, methods
func Func(in, out []*Type, variadic bool) *FuncType {
ret := &FuncType{
Type: Type{
Size_: unsafe.Sizeof(uintptr(0)),
Size_: 2 * unsafe.Sizeof(uintptr(0)),
PtrBytes: 2 * pointerSize,
Hash: uint32(abi.Func), // TODO(xsw): hash
Align_: uint8(pointerAlign),
FieldAlign_: uint8(pointerAlign),
@@ -212,6 +213,7 @@ func Interface(pkgPath, name string, methods []Imethod) *InterfaceType {
ret := &abi.InterfaceType{
Type: Type{
Size_: unsafe.Sizeof(eface{}),
PtrBytes: 2 * pointerSize,
Hash: uint32(abi.Interface), // TODO(xsw): hash
Align_: uint8(pointerAlign),
FieldAlign_: uint8(pointerAlign),