Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 55 for makeTag (0.13 sec)

  1. test/live.go

    type T40 struct {
    	m map[int]int
    }
    
    //go:noescape
    func useT40(*T40)
    
    func newT40() *T40 {
    	ret := T40{}
    	ret.m = make(map[int]int, 42) // ERROR "live at call to makemap: &ret$"
    	return &ret
    }
    
    func bad40() {
    	t := newT40()
    	_ = t
    	printnl()
    }
    
    func good40() {
    	ret := T40{}              // ERROR "stack object ret T40$"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 20:34:30 UTC 2023
    - 18K bytes
    - Viewed (0)
  2. src/net/rpc/server.go

    		return
    	}
    	if argIsValue {
    		argv = argv.Elem()
    	}
    
    	replyv = reflect.New(mtype.ReplyType.Elem())
    
    	switch mtype.ReplyType.Elem().Kind() {
    	case reflect.Map:
    		replyv.Elem().Set(reflect.MakeMap(mtype.ReplyType.Elem()))
    	case reflect.Slice:
    		replyv.Elem().Set(reflect.MakeSlice(mtype.ReplyType.Elem(), 0, 0))
    	}
    	return
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 21.6K bytes
    - Viewed (0)
  3. src/go/internal/gcimporter/iimport.go

    		val = constant.Make(&x)
    
    	case types.IsFloat:
    		val = r.mpfloat(b)
    
    	case types.IsComplex:
    		re := r.mpfloat(b)
    		im := r.mpfloat(b)
    		val = constant.BinaryOp(re, token.ADD, constant.MakeImag(im))
    
    	default:
    		errorf("unexpected type %v", typ) // panics
    		panic("unreachable")
    	}
    
    	return
    }
    
    func intSize(b *types.Basic) (signed bool, maxBytes uint) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 19.2K bytes
    - Viewed (0)
  4. test/live_regabi.go

    type T40 struct {
    	m map[int]int
    }
    
    //go:noescape
    func useT40(*T40)
    
    func newT40() *T40 {
    	ret := T40{}
    	ret.m = make(map[int]int, 42) // ERROR "live at call to makemap: &ret$"
    	return &ret
    }
    
    func bad40() {
    	t := newT40()
    	_ = t
    	printnl()
    }
    
    func good40() {
    	ret := T40{}              // ERROR "stack object ret T40$"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 20:34:30 UTC 2023
    - 18.4K bytes
    - Viewed (0)
  5. src/reflect/value.go

    		panic("reflect.MakeChan: unidirectional channel type")
    	}
    	t := typ.common()
    	ch := makechan(t, buffer)
    	return Value{t, ch, flag(Chan)}
    }
    
    // MakeMap creates a new map with the specified type.
    func MakeMap(typ Type) Value {
    	return MakeMapWithSize(typ, 0)
    }
    
    // MakeMapWithSize creates a new map with the specified type
    // and initial space for approximately n elements.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:17:41 UTC 2024
    - 119.9K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/staticinit/sched.go

    		n := n.(*ir.BinaryExpr)
    		if n.Y.Op() != ir.OLITERAL || constant.Sign(n.Y.Val()) == 0 {
    			return true
    		}
    
    	// Only possible side effect is panic on invalid size,
    	// but many makechan and makemap use size zero, which is definitely OK.
    	case ir.OMAKECHAN, ir.OMAKEMAP:
    		n := n.(*ir.MakeExpr)
    		if !ir.IsConst(n.Len, constant.Int) || constant.Sign(n.Len.Val()) != 0 {
    			return true
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 17:16:14 UTC 2024
    - 30.7K bytes
    - Viewed (0)
  7. src/encoding/json/decode.go

    				d.saveError(&UnmarshalTypeError{Value: "object", Type: t, Offset: int64(d.off)})
    				d.skip()
    				return nil
    			}
    		}
    		if v.IsNil() {
    			v.Set(reflect.MakeMap(t))
    		}
    	case reflect.Struct:
    		fields = cachedTypeFields(t)
    		// ok
    	default:
    		d.saveError(&UnmarshalTypeError{Value: "object", Type: t, Offset: int64(d.off)})
    		d.skip()
    		return nil
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:18:55 UTC 2024
    - 35.3K bytes
    - Viewed (0)
  8. guava/src/com/google/common/collect/Ordering.java

        private final AtomicInteger counter = new AtomicInteger(0);
        private final ConcurrentMap<Object, Integer> uids =
            Platform.tryWeakKeys(new MapMaker()).makeMap();
    
        private Integer getUid(Object obj) {
          Integer uid = uids.get(obj);
          if (uid == null) {
            // One or more integer values could be skipped in the event of a race
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue May 28 18:11:09 UTC 2024
    - 39.4K bytes
    - Viewed (0)
  9. src/runtime/map_test.go

    				escapingMap[i] = i
    			}
    			if got := runtime.MapBucketsCount(escapingMap); got != tt.escape {
    				t.Errorf("escape: n=%d want %d buckets, got %d", tt.n, tt.escape, got)
    			}
    		}
    	})
    	t.Run("makemap", func(t *testing.T) {
    		for _, tt := range mapBucketTests {
    			localMap := make(map[int]int, tt.n)
    			if runtime.MapBucketsPointerIsNil(localMap) {
    				t.Errorf("no escape: buckets pointer is nil for non-escaping map")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 33.5K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/collect/Ordering.java

        private final AtomicInteger counter = new AtomicInteger(0);
        private final ConcurrentMap<Object, Integer> uids =
            Platform.tryWeakKeys(new MapMaker()).makeMap();
    
        private Integer getUid(Object obj) {
          Integer uid = uids.get(obj);
          if (uid == null) {
            // One or more integer values could be skipped in the event of a race
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue May 28 18:11:09 UTC 2024
    - 39.4K bytes
    - Viewed (0)
Back to top