Search Options

Results per page
Sort
Preferred Languages
Advance

Results 91 - 100 of 183 for iface (0.06 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. src/reflect/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() == abi.Interface {
    		v := (*interfaceType)(unsafe.Pointer(V))
    		i := 0
    		for j := 0; j < len(v.Methods); j++ {
    			tm := &t.Methods[i]
    			tmName := t.nameOff(tm.Name)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 85.5K bytes
    - Viewed (0)
  10. src/runtime/runtime2.go

    	key uintptr
    }
    
    type funcval struct {
    	fn uintptr
    	// variable-size, fn-specific data here
    }
    
    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))
    }
    
    // The guintptr, muintptr, and puintptr are all used to bypass write barriers.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:57:37 UTC 2024
    - 47.9K bytes
    - Viewed (0)
Back to top