Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 51 for Measure (1.05 sec)

  1. src/cmd/compile/internal/types2/assignments.go

    		}
    		res = append(res, s)
    	}
    	return "(" + strings.Join(res, ", ") + ")"
    }
    
    func measure(x int, unit string) string {
    	if x != 1 {
    		unit += "s"
    	}
    	return fmt.Sprintf("%d %s", x, unit)
    }
    
    func (check *Checker) assignError(rhs []syntax.Expr, l, r int) {
    	vars := measure(l, "variable")
    	vals := measure(r, "value")
    	rhs0 := rhs[0]
    
    	if len(rhs) == 1 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 23 21:21:43 UTC 2024
    - 16.4K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/signature.go

    				}
    			} else if len(tparams) < len(recvTParams) {
    				// Reporting an error here is a stop-gap measure to avoid crashes in the
    				// compiler when a type parameter/argument cannot be inferred later. It
    				// may lead to follow-on errors (see issues go.dev/issue/51339, go.dev/issue/51343).
    				// TODO(gri) find a better solution
    				got := measure(len(tparams), "type parameter")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 21:33:05 UTC 2024
    - 12.6K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/walk/switch.go

    	// equality comparison, they don't get CSEd and the equality comparisons will be
    	// done using wider loads.
    
    	n := len(ir.StringVal(cc[0].lo)) // Length of the constant strings.
    	bestScore := int64(0)            // measure of how good the split is.
    	bestIdx := 0                     // split using expr[bestIdx]
    	bestByte := int8(0)              // compare expr[bestIdx] against bestByte
    	for idx := 0; idx < n; idx++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 30.1K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/ssa/schedule.go

    		for _, v := range b.Values {
    			switch {
    			case v.Op.isLoweredGetClosurePtr():
    				// We also score GetLoweredClosurePtr as early as possible to ensure that the
    				// context register is not stomped. GetLoweredClosurePtr should only appear
    				// in the entry block where there are no phi functions, so there is no
    				// conflict or ambiguity here.
    				if b != f.Entry {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 08 15:53:17 UTC 2024
    - 16.4K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/ssagen/abi.go

    	// definition ABI to C. That also means that we don't want to
    	// create ABI wrappers even if there's a linkname.
    	//
    	// TODO(austin): Maybe we want to create the ABI wrappers, but
    	// ensure the linker exports the right ABI definition under
    	// the unmangled name?
    	cgoExports := make(map[string][]*[]string)
    	for i, prag := range typecheck.Target.CgoPragmas {
    		switch prag[0] {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 19:57:43 UTC 2024
    - 13.8K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types2/api.go

    	// If FakeImportC is set, `import "C"` (for packages requiring Cgo)
    	// declares an empty "C" package and errors are omitted for qualified
    	// identifiers referring to package C (which won't find an object).
    	// This feature is intended for the standard library cmd/api tool.
    	//
    	// Caution: Effects may be unpredictable due to follow-on errors.
    	//          Do not use casually!
    	FakeImportC bool
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 13:48:53 UTC 2024
    - 17.4K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/staticinit/sched.go

    		fallthrough
    	case ir.ONAME:
    		r := r.(*ir.Name)
    		if s.staticcopy(l, loff, r, typ) {
    			return true
    		}
    		// We may have skipped past one or more OCONVNOPs, so
    		// use conv to ensure r is assignable to l (#13263).
    		dst := ir.Node(l)
    		if loff != 0 || !types.Identical(typ, l.Type()) {
    			dst = ir.NewNameOffsetExpr(base.Pos, l, loff, typ)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 17:16:14 UTC 2024
    - 30.7K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/ssa/memcombine.go

    package ssa
    
    import (
    	"cmd/compile/internal/base"
    	"cmd/compile/internal/types"
    	"cmd/internal/src"
    	"sort"
    )
    
    // memcombine combines smaller loads and stores into larger ones.
    // We ensure this generates good code for encoding/binary operations.
    // It may help other cases also.
    func memcombine(f *Func) {
    	// This optimization requires that the architecture has
    	// unaligned loads and unaligned stores.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 19:45:41 UTC 2024
    - 18.4K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types2/decl.go

    			t.implicit = true
    		}
    		return t
    	}
    	return check.typ(x)
    }
    
    func (check *Checker) declareTypeParam(name *syntax.Name, scopePos syntax.Pos) *TypeParam {
    	// Use Typ[Invalid] for the type constraint to ensure that a type
    	// is present even if the actual constraint has not been assigned
    	// yet.
    	// TODO(gri) Need to systematically review all uses of type parameter
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 29.6K bytes
    - Viewed (0)
  10. doc/go_mem.html

    the semaphore.
    This is a common idiom for limiting concurrency.
    </p>
    
    <p>
    This program starts a goroutine for every entry in the work list, but the
    goroutines coordinate using the <code>limit</code> channel to ensure
    that at most three are running work functions at a time.
    </p>
    
    <pre>
    var limit = make(chan int, 3)
    
    func main() {
    	for _, w := range work {
    		go func(w func()) {
    			limit &lt;- 1
    			w()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 15:54:42 UTC 2024
    - 26.6K bytes
    - Viewed (0)
Back to top