Search Options

Results per page
Sort
Preferred Languages
Advance

Results 71 - 80 of 135 for iface (0.04 sec)

  1. src/runtime/mfinal.go

    					ityp := (*interfacetype)(unsafe.Pointer(f.fint))
    					// set up with empty interface
    					(*eface)(r)._type = &f.ot.Type
    					(*eface)(r).data = f.arg
    					if len(ityp.Methods) != 0 {
    						// convert to interface with methods
    						// this conversion is guaranteed to succeed - we checked in SetFinalizer
    						(*iface)(r).tab = assertE2I(ityp, (*eface)(r)._type)
    					}
    				default:
    					throw("bad kind in runfinq")
    				}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 01:56:56 UTC 2024
    - 19K bytes
    - Viewed (0)
  2. src/encoding/xml/marshal.go

    			if dashLast {
    				// "--->" is invalid grammar. Make it "- -->"
    				p.WriteByte(' ')
    			}
    			p.WriteString("-->")
    			continue
    
    		case fInnerXML:
    			vf = indirect(vf)
    			iface := vf.Interface()
    			switch raw := iface.(type) {
    			case []byte:
    				p.Write(raw)
    				continue
    			case string:
    				p.WriteString(raw)
    				continue
    			}
    
    		case fElement, fElement | fAny:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 18:46:41 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  3. src/internal/reflectlite/type.go

    	// methods along the way, or else V does not implement T.
    	// This lets us run the scan in overall linear time instead of
    	// the quadratic time  a naive search would require.
    	// See also ../runtime/iface.go.
    	if V.Kind() == Interface {
    		v := (*interfaceType)(unsafe.Pointer(V))
    		i := 0
    		for j := 0; j < len(v.Methods); j++ {
    			tm := &t.Methods[i]
    			tmName := rT.nameOff(tm.Name)
    			vm := &v.Methods[j]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 17:01:54 UTC 2024
    - 16.2K bytes
    - Viewed (0)
  4. src/reflect/value.go

    		if !tt.nameOff(m.Name).IsExported() {
    			panic("reflect: " + op + " of unexported method")
    		}
    		iface := (*nonEmptyInterface)(v.ptr)
    		if iface.itab == nil {
    			panic("reflect: " + op + " of method on nil interface value")
    		}
    		rcvrtype = iface.itab.Type
    		fn = unsafe.Pointer(&unsafe.Slice(&iface.itab.Fun[0], i+1)[i])
    		t = (*funcType)(unsafe.Pointer(tt.typeOff(m.Typ)))
    	} else {
    		rcvrtype = v.typ()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:17:41 UTC 2024
    - 119.9K bytes
    - Viewed (0)
  5. src/text/template/exec.go

    // the template.
    func (s *state) printValue(n parse.Node, v reflect.Value) {
    	s.at(n)
    	iface, ok := printableValue(v)
    	if !ok {
    		s.errorf("can't print %s of type %s", n, v.Type())
    	}
    	_, err := fmt.Fprint(s.wr, iface)
    	if err != nil {
    		s.writeError(err)
    	}
    }
    
    // printableValue returns the, possibly indirected, interface value inside v that
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 21:22:24 UTC 2024
    - 32K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/walk/convert.go

    		nif.Body = []ir.Node{ir.NewAssignStmt(base.Pos, typeWord, itabType(typeWord))}
    		init.Append(nif)
    
    		// Build the result.
    		// e = iface{typeWord, data}
    		e := ir.NewBinaryExpr(base.Pos, ir.OMAKEFACE, typeWord, data)
    		e.SetType(toType) // assign type manually, typecheck doesn't understand OEFACE.
    		e.SetTypecheck(1)
    		return e
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 09 17:28:22 UTC 2023
    - 18.2K bytes
    - Viewed (0)
  7. src/cmd/cgo/internal/testshared/shared_test.go

    	// Note: iface_i gets installed implicitly as a dependency of iface_a.
    	goCmd(t, "install", "-buildmode=shared", "-linkshared", "./iface_b")
    	goCmd(t, "install", "-linkshared", "./iface")
    	run(t, "running type/itab uniqueness tester", "../../bin/iface")
    }
    
    // Access a global variable from a library.
    func TestGlobal(t *testing.T) {
    	globalSkip(t)
    	goCmd(t, "install", "-buildmode=shared", "-linkshared", "./globallib")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Aug 26 01:54:41 UTC 2023
    - 36.3K bytes
    - Viewed (0)
  8. src/runtime/hash_test.go

    	return 64
    }
    func (k *IfaceKey) flipBit(i int) {
    	k.i = k.i.(fInter) ^ fInter(1)<<uint(i)
    }
    func (k *IfaceKey) hash() uintptr {
    	return IfaceHash(k.i, 0)
    }
    func (k *IfaceKey) name() string {
    	return "Iface"
    }
    
    // Flipping a single bit of a key should flip each output bit with 50% probability.
    func TestSmhasherAvalanche(t *testing.T) {
    	if GOARCH == "wasm" {
    		t.Skip("Too slow on wasm")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 06 17:50:18 UTC 2024
    - 18.4K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types/type.go

    	case TCHAN,
    		TMAP,
    		TFUNC,
    		TUNSAFEPTR:
    		return true
    
    	case TARRAY:
    		// Array of 1 direct iface type can be direct.
    		return t.NumElem() == 1 && IsDirectIface(t.Elem())
    
    	case TSTRUCT:
    		// Struct with 1 field of direct iface type can be direct.
    		return t.NumFields() == 1 && IsDirectIface(t.Field(0).Type)
    	}
    
    	return false
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 49.5K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/walk/switch.go

    				as := ir.NewAssignListStmt(c.pos, ir.OAS2,
    					[]ir.Node{ir.BlankNode, s.okName},                               // _, ok =
    					[]ir.Node{ir.NewTypeAssertExpr(c.pos, s.srcName, c.typ.Type())}) // iface.(type)
    				nif := ir.NewIfStmt(c.pos, s.okName, []ir.Node{c.jmp}, nil)
    				clauses = append(clauses, typeClause{
    					hash: types.TypeHash(c.typ.Type()),
    					body: []ir.Node{typecheck.Stmt(as), typecheck.Stmt(nif)},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 30.1K bytes
    - Viewed (0)
Back to top