Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 59 for makeslice (0.38 sec)

  1. test/makeslice.go

    Martin Möhrmann <******@****.***> 1540295407 +0200
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 07 17:50:24 UTC 2020
    - 5.5K bytes
    - Viewed (0)
  2. test/codegen/slices.go

    	// amd64:-`.*runtime\.makeslice`
    	// ppc64x:`.*runtime\.memclrHasPointers`
    	// ppc64x:-`.*runtime\.makeslice`
    	return append(s, make([]*int, l)...)
    }
    
    func SliceExtensionVar(s []byte, l int) []byte {
    	// amd64:`.*runtime\.memclrNoHeapPointers`
    	// amd64:-`.*runtime\.makeslice`
    	// ppc64x:`.*runtime\.memclrNoHeapPointers`
    	// ppc64x:-`.*runtime\.makeslice`
    	return append(s, make([]byte, l)...)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 23 18:57:27 UTC 2023
    - 9.8K bytes
    - Viewed (0)
  3. test/range.go

    var nmake = 0
    
    func makeslice() []int {
    	nmake++
    	return []int{1, 2, 3, 4, 5}
    }
    
    func testslice() {
    	s := 0
    	nmake = 0
    	for _, v := range makeslice() {
    		s += v
    	}
    	if nmake != 1 {
    		println("range called makeslice", nmake, "times")
    		panic("fail")
    	}
    	if s != 15 {
    		println("wrong sum ranging over makeslice", s)
    		panic("fail")
    	}
    
    	x := []int{10, 20}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 05:50:54 UTC 2017
    - 8.1K bytes
    - Viewed (0)
  4. callbacks/associations.go

    				isPtr := fieldType.Kind() == reflect.Ptr
    				if !isPtr {
    					fieldType = reflect.PtrTo(fieldType)
    				}
    				elems := reflect.MakeSlice(reflect.SliceOf(fieldType), 0, 10)
    				distinctElems := reflect.MakeSlice(reflect.SliceOf(fieldType), 0, 10)
    				joins := reflect.MakeSlice(reflect.SliceOf(reflect.PtrTo(rel.JoinTable.ModelType)), 0, 10)
    				objs := []reflect.Value{}
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Tue Apr 11 03:06:13 UTC 2023
    - 14.3K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. test/arenas/smoke.go

    		// that *i crashes for some reason. Still, why not check it.
    		log.Fatalf("bad i value: got %d, want %d", *i, iValue)
    	}
    
    	const wantLen = 125
    	const wantCap = 1912
    
    	sl := arena.MakeSlice[*int](a, wantLen, wantCap)
    	if len(sl) != wantLen {
    		log.Fatalf("bad arena slice length: got %d, want %d", len(sl), wantLen)
    	}
    	if cap(sl) != wantCap {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 16 17:08:43 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  8. 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)
  9. 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)
  10. 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)
Back to top