Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 43 for makeslice (0.15 sec)

  1. callbacks/preload.go

    			if joined, nestedJoins := isJoined(name); joined {
    				switch rv := db.Statement.ReflectValue; rv.Kind() {
    				case reflect.Slice, reflect.Array:
    					if rv.Len() > 0 {
    						reflectValue := rel.FieldSchema.MakeSlice().Elem()
    						for i := 0; i < rv.Len(); i++ {
    							frv := rel.Field.ReflectValueOf(db.Statement.Context, rv.Index(i))
    							if frv.Kind() != reflect.Ptr {
    								reflectValue = reflect.Append(reflectValue, frv.Addr())
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:52:33 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  2. src/runtime/slice.go

    	}
    
    	memmove(to, from, copymem)
    
    	return to
    }
    
    // makeslice should be an internal detail,
    // but widely used packages access it using linkname.
    // Notable members of the hall of shame include:
    //   - github.com/bytedance/sonic
    //
    // Do not remove or change the type signature.
    // See go.dev/issue/67401.
    //
    //go:linkname makeslice
    func makeslice(et *_type, len, cap int) unsafe.Pointer {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 16:25:21 UTC 2024
    - 12.2K bytes
    - Viewed (0)
  3. schema/schema.go

    		return fmt.Sprintf("%s(%s)", schema.Name, schema.Table)
    	}
    	return fmt.Sprintf("%s.%s", schema.ModelType.PkgPath(), schema.ModelType.Name())
    }
    
    func (schema Schema) MakeSlice() reflect.Value {
    	slice := reflect.MakeSlice(reflect.SliceOf(reflect.PointerTo(schema.ModelType)), 0, 20)
    	results := reflect.New(slice.Type())
    	results.Elem().Set(slice)
    
    	return results
    }
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:52:33 UTC 2024
    - 13.7K bytes
    - Viewed (0)
  4. src/cmd/internal/goobj/builtinlist.go

    	{"runtime.typedslicecopy", 1},
    	{"runtime.selectnbsend", 1},
    	{"runtime.selectnbrecv", 1},
    	{"runtime.selectsetpc", 1},
    	{"runtime.selectgo", 1},
    	{"runtime.block", 1},
    	{"runtime.makeslice", 1},
    	{"runtime.makeslice64", 1},
    	{"runtime.makeslicecopy", 1},
    	{"runtime.growslice", 1},
    	{"runtime.unsafeslicecheckptr", 1},
    	{"runtime.panicunsafeslicelen", 1},
    	{"runtime.panicunsafeslicenilptr", 1},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 21 21:08:03 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  5. schema/utils.go

    func GetRelationsValues(ctx context.Context, reflectValue reflect.Value, rels []*Relationship) (reflectResults reflect.Value) {
    	for _, rel := range rels {
    		reflectResults = reflect.MakeSlice(reflect.SliceOf(reflect.PtrTo(rel.FieldSchema.ModelType)), 0, 1)
    
    		appendToResults := func(value reflect.Value) {
    			if _, isZero := rel.Field.ValueOf(ctx, value); !isZero {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Sat Aug 19 13:35:14 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apimachinery/pkg/runtime/converter.go

    			}
    			dv.SetBytes(data)
    		} else {
    			dv.Set(reflect.MakeSlice(dt, 0, 0))
    		}
    		return nil
    	}
    	if st.Kind() != reflect.Slice {
    		return fmt.Errorf("cannot restore slice from %v", st.Kind())
    	}
    
    	if sv.IsNil() {
    		dv.Set(reflect.Zero(dt))
    		return nil
    	}
    	dv.Set(reflect.MakeSlice(dt, sv.Len(), sv.Cap()))
    
    	pathLen := len(ctx.parentPath)
    	defer func() {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jul 11 16:02:13 UTC 2023
    - 24.9K bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top