8 type UnsafePtrType struct {
12 func newUnsafePtrType(cfg *frozenConfig, type1 reflect.Type) *UnsafePtrType {
13 return &UnsafePtrType{
14 unsafeType: *newUnsafeType(cfg, type1),
18 func (type2 *UnsafePtrType) IsNil(obj interface{}) bool {
22 objEFace := unpackEFace(obj)
23 assertType("Type.IsNil argument 1", type2.ptrRType, objEFace.rtype)
24 return type2.UnsafeIsNil(objEFace.data)
27 func (type2 *UnsafePtrType) UnsafeIsNil(ptr unsafe.Pointer) bool {
31 return *(*unsafe.Pointer)(ptr) == nil
34 func (type2 *UnsafePtrType) LikePtr() bool {
38 func (type2 *UnsafePtrType) Indirect(obj interface{}) interface{} {
39 objEFace := unpackEFace(obj)
40 assertType("Type.Indirect argument 1", type2.ptrRType, objEFace.rtype)
41 return type2.UnsafeIndirect(objEFace.data)
44 func (type2 *UnsafePtrType) UnsafeIndirect(ptr unsafe.Pointer) interface{} {
45 return packEFace(type2.rtype, *(*unsafe.Pointer)(ptr))