Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 52 for makeslice (0.23 sec)

  1. src/cmd/compile/internal/walk/builtin.go

    		return walkExpr(typecheck.Expr(typecheck.Conv(r, n.Type())), init)
    	}
    
    	// n escapes; set up a call to makeslice.
    	// When len and cap can fit into int, use makeslice instead of
    	// makeslice64, which is faster and shorter on 32 bit platforms.
    
    	len, cap := l, r
    
    	fnname := "makeslice64"
    	argtype := types.Types[types.TINT64]
    
    	// Type checking guarantees that TIDEAL len/cap are positive and fit in an int.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 22:35:22 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  2. association.go

    			var fieldValue reflect.Value
    			if clear {
    				fieldValue = reflect.MakeSlice(oldFieldValue.Type(), 0, oldFieldValue.Cap())
    			} else {
    				fieldValue = reflect.MakeSlice(oldFieldValue.Type(), oldFieldValue.Len(), oldFieldValue.Cap())
    				reflect.Copy(fieldValue, oldFieldValue)
    			}
    
    			appendToFieldValues := func(ev reflect.Value) {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:49:45 UTC 2024
    - 21.5K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/api/apitesting/roundtrip/construct.go

    		// use the custom fill function for this type
    		f(dataString, dataInt, v.Interface())
    		return
    	}
    
    	switch t.Kind() {
    	case reflect.Slice:
    		// populate with a single-item slice
    		v.Set(reflect.MakeSlice(t, 1, 1))
    		// recurse to populate the item, preserving the data context
    		if t.Elem().Kind() == reflect.Pointer {
    			fill(dataString, dataInt, t.Elem(), v.Index(0), fillFuncs, filledTypes)
    		} else {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Feb 27 19:12:59 UTC 2023
    - 6.5K bytes
    - Viewed (0)
  4. scan.go

    				} else {
    					// if the slice cap is externally initialized, the externally initialized slice is directly used here
    					if reflectValue.Cap() == 0 {
    						db.Statement.ReflectValue.Set(reflect.MakeSlice(reflectValue.Type(), 0, 20))
    					} else {
    						reflectValue.SetLen(0)
    						db.Statement.ReflectValue.Set(reflectValue)
    					}
    				}
    			}
    
    			for initialized || rows.Next() {
    			BEGIN:
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:57:36 UTC 2024
    - 10K bytes
    - Viewed (0)
  5. src/cmd/gofmt/rewrite.go

    		if p.IsNil() {
    			// Do not turn nil slices into empty slices. go/ast
    			// guarantees that certain lists will be nil if not
    			// populated.
    			return reflect.Zero(p.Type())
    		}
    		v := reflect.MakeSlice(p.Type(), p.Len(), p.Len())
    		for i := 0; i < p.Len(); i++ {
    			v.Index(i).Set(subst(m, p.Index(i), pos))
    		}
    		return v
    
    	case reflect.Struct:
    		v := reflect.New(p.Type()).Elem()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 27 22:07:13 UTC 2023
    - 8.1K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go

    		}
    	}
    	if len(sizes) == 0 || max > maxCapacity {
    		max = maxCapacity
    	}
    	if max <= cap {
    		return
    	}
    	if v.Len() > 0 {
    		extra := reflect.MakeSlice(v.Type(), v.Len(), max)
    		reflect.Copy(extra, v)
    		v.Set(extra)
    	} else {
    		extra := reflect.MakeSlice(v.Type(), 0, max)
    		v.Set(extra)
    	}
    }
    
    // Watch implements storage.Interface.Watch.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 11:56:42 UTC 2024
    - 35.2K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apimachinery/pkg/api/meta/help.go

    	}
    	items, err := conversion.EnforcePtr(itemsPtr)
    	if err != nil {
    		return err
    	}
    	if items.Type() == objectSliceType {
    		items.Set(reflect.ValueOf(objects))
    		return nil
    	}
    	slice := reflect.MakeSlice(items.Type(), len(objects), len(objects))
    	for i := range objects {
    		dest := slice.Index(i)
    		if dest.Type() == rawExtensionObjectType {
    			dest = dest.FieldByName("Object")
    		}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 29 16:25:43 UTC 2023
    - 9.8K bytes
    - Viewed (0)
  8. src/testing/quick/quick.go

    				return reflect.Value{}, false
    			}
    			v.Set(reflect.New(concrete.Elem()))
    			v.Elem().Set(elem)
    		}
    	case reflect.Slice:
    		numElems := rand.Intn(size)
    		sizeLeft := size - numElems
    		v.Set(reflect.MakeSlice(concrete, numElems, numElems))
    		for i := 0; i < numElems; i++ {
    			elem, ok := sizedValue(concrete.Elem(), rand, sizeLeft)
    			if !ok {
    				return reflect.Value{}, false
    			}
    			v.Index(i).Set(elem)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 08 17:55:47 UTC 2023
    - 10.1K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/typecheck/_builtin/runtime.go

    func selectsetpc(pc *uintptr)
    func selectgo(cas0 *byte, order0 *byte, pc0 *uintptr, nsends int, nrecvs int, block bool) (int, bool)
    func block()
    
    func makeslice(typ *byte, len int, cap int) unsafe.Pointer
    func makeslice64(typ *byte, len int64, cap int64) unsafe.Pointer
    func makeslicecopy(typ *byte, tolen int, fromlen int, from unsafe.Pointer) unsafe.Pointer
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 21 21:08:03 UTC 2024
    - 10.6K bytes
    - Viewed (0)
  10. src/reflect/value.go

    // MakeSlice creates a new zero-initialized slice value
    // for the specified slice type, length, and capacity.
    func MakeSlice(typ Type, len, cap int) Value {
    	if typ.Kind() != Slice {
    		panic("reflect.MakeSlice of non-slice type")
    	}
    	if len < 0 {
    		panic("reflect.MakeSlice: negative len")
    	}
    	if cap < 0 {
    		panic("reflect.MakeSlice: negative cap")
    	}
    	if len > cap {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:17:41 UTC 2024
    - 119.9K bytes
    - Viewed (0)
Back to top