Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 62 for isChan (0.14 sec)

  1. src/runtime/time.go

    	//
    	// Package time does not know about seq, but if this is a channel timer (t.isChan == true),
    	// this file uses t.seq as a sequence number to recognize and squelch
    	// sends that correspond to an earlier (stale) timer configuration,
    	// similar to its use in netpoll. In this usage (that is, when t.isChan == true),
    	// writes to seq are protected by both t.mu and t.sendLock,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 29 14:36:24 UTC 2024
    - 37.5K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/walk/walk.go

    	n := vmkcall(fn, nil, &init, args)
    	if len(init) == 0 {
    		return n
    	}
    	init.Append(n)
    	return ir.NewBlockStmt(n.Pos(), init)
    }
    
    func chanfn(name string, n int, t *types.Type) ir.Node {
    	if !t.IsChan() {
    		base.Fatalf("chanfn %v", t)
    	}
    	switch n {
    	case 1:
    		return typecheck.LookupRuntime(name, t.Elem())
    	case 2:
    		return typecheck.LookupRuntime(name, t.Elem(), t.Elem())
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 27 20:56:00 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/typecheck/expr.go

    // tcRecv typechecks an ORECV node.
    func tcRecv(n *ir.UnaryExpr) ir.Node {
    	n.X = Expr(n.X)
    	n.X = DefaultLit(n.X, nil)
    	l := n.X
    	t := l.Type()
    	if t == nil {
    		n.SetType(nil)
    		return n
    	}
    	if !t.IsChan() {
    		base.Errorf("invalid operation: %v (receive from non-chan type %v)", n, t)
    		n.SetType(nil)
    		return n
    	}
    
    	if !t.ChanDir().CanRecv() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/typecheck/func.go

    func tcClose(n *ir.UnaryExpr) ir.Node {
    	n.X = Expr(n.X)
    	n.X = DefaultLit(n.X, nil)
    	l := n.X
    	t := l.Type()
    	if t == nil {
    		n.SetType(nil)
    		return n
    	}
    	if !t.IsChan() {
    		base.Errorf("invalid operation: %v (non-chan type %v)", n, t)
    		n.SetType(nil)
    		return n
    	}
    
    	if !t.ChanDir().CanSend() {
    		base.Errorf("invalid operation: %v (cannot close receive-only channel)", n)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 06 15:23:18 UTC 2024
    - 21.1K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/walk/builtin.go

    // is a correctness rewrite, not an optimization.
    func isChanLenCap(n ir.Node) bool {
    	return (n.Op() == ir.OLEN || n.Op() == ir.OCAP) && n.(*ir.UnaryExpr).X.Type().IsChan()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 22:35:22 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types/type.go

    		return true
    	}
    	return false
    }
    
    func (t *Type) IsString() bool {
    	return t.kind == TSTRING
    }
    
    func (t *Type) IsMap() bool {
    	return t.kind == TMAP
    }
    
    func (t *Type) IsChan() bool {
    	return t.kind == TCHAN
    }
    
    func (t *Type) IsSlice() bool {
    	return t.kind == TSLICE
    }
    
    func (t *Type) IsArray() bool {
    	return t.kind == TARRAY
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 49.5K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/ssagen/ssa.go

    func (s *state) referenceTypeBuiltin(n *ir.UnaryExpr, x *ssa.Value) *ssa.Value {
    	if !n.X.Type().IsMap() && !n.X.Type().IsChan() {
    		s.Fatalf("node must be a map or a channel")
    	}
    	if n.X.Type().IsChan() && n.Op() == ir.OLEN {
    		s.Fatalf("cannot inline len(chan)") // must use runtime.chanlen now
    	}
    	if n.X.Type().IsChan() && n.Op() == ir.OCAP {
    		s.Fatalf("cannot inline cap(chan)") // must use runtime.chancap now
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 19:44:43 UTC 2024
    - 284.9K bytes
    - Viewed (0)
  8. src/cmp/cmp.go

    func Less[T Ordered](x, y T) bool {
    	return (isNaN(x) && !isNaN(y)) || x < y
    }
    
    // Compare returns
    //
    //	-1 if x is less than y,
    //	 0 if x equals y,
    //	+1 if x is greater than y.
    //
    // For floating-point types, a NaN is considered less than any non-NaN,
    // a NaN is considered equal to a NaN, and -0.0 is equal to 0.0.
    func Compare[T Ordered](x, y T) int {
    	xNaN := isNaN(x)
    	yNaN := isNaN(y)
    	if xNaN {
    		if yNaN {
    			return 0
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 19 16:31:02 UTC 2024
    - 2K bytes
    - Viewed (0)
  9. src/runtime/minmax_test.go

    			t.Errorf("min(%v, %v) = %v, want %v", tt.max, tt.min, z, tt.min)
    		}
    	}
    	for _, x := range all {
    		if z := min(nan, x); !math.IsNaN(z) {
    			t.Errorf("min(%v, %v) = %v, want %v", nan, x, z, nan)
    		}
    		if z := min(x, nan); !math.IsNaN(z) {
    			t.Errorf("min(%v, %v) = %v, want %v", nan, x, z, nan)
    		}
    	}
    }
    
    func TestMaxFloat(t *testing.T) {
    	for _, tt := range tests {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 26 01:41:50 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  10. test/typeparam/graph.go

    func _SliceEqual[Elem comparable](s1, s2 []Elem) bool {
    	if len(s1) != len(s2) {
    		return false
    	}
    	for i, v1 := range s1 {
    		v2 := s2[i]
    		if v1 != v2 {
    			isNaN := func(f Elem) bool { return f != f }
    			if !isNaN(v1) || !isNaN(v2) {
    				return false
    			}
    		}
    	}
    	return true
    }
    
    // A Graph is a collection of nodes. A node may have an arbitrary number
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 5.7K bytes
    - Viewed (0)
Back to top