Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for makeslice (0.28 sec)

  1. 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)
  2. 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)
  3. 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)
  4. src/encoding/gob/timing_test.go

    	rt := ra.Type()
    	b.ResetTimer()
    
    	b.ReportAllocs()
    	b.RunParallel(func(pb *testing.PB) {
    		// TODO(#19025): Move per-thread allocation before ResetTimer.
    		rp := reflect.New(rt)
    		rp.Elem().Set(reflect.MakeSlice(rt, ra.Len(), ra.Cap()))
    		p := rp.Interface()
    
    		bbuf := benchmarkBuf{data: buf.Bytes()}
    
    		for pb.Next() {
    			bbuf.reset()
    			dec := NewDecoder(&bbuf)
    			err := dec.Decode(p)
    			if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 04 07:16:59 UTC 2023
    - 6.5K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. src/os/dir_windows.go

    				nextEntryOffset = info.NextEntryOffset
    				nameslice = unsafe.Slice(&info.FileName[0], info.FileNameLength/2)
    			}
    			d.bufp += int(nextEntryOffset)
    			islast = nextEntryOffset == 0
    			if islast {
    				d.bufp = 0
    			}
    			if (len(nameslice) == 1 && nameslice[0] == '.') ||
    				(len(nameslice) == 2 && nameslice[0] == '.' && nameslice[1] == '.') {
    				// Ignore "." and ".." and avoid allocating a string for them.
    				continue
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 20:52:06 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  8. src/net/http/mapping.go

    }
    
    type entry[K comparable, V any] struct {
    	key   K
    	value V
    }
    
    // maxSlice is the maximum number of pairs for which a slice is used.
    // It is a variable for benchmarking.
    var maxSlice int = 8
    
    // add adds a key-value pair to the mapping.
    func (h *mapping[K, V]) add(k K, v V) {
    	if h.m == nil && len(h.s) < maxSlice {
    		h.s = append(h.s, entry[K, V]{k, v})
    	} else {
    		if h.m == nil {
    			h.m = map[K]V{}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 17:47:07 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  9. src/net/http/mapping_test.go

    import (
    	"cmp"
    	"fmt"
    	"slices"
    	"strconv"
    	"testing"
    )
    
    func TestMapping(t *testing.T) {
    	var m mapping[int, string]
    	for i := 0; i < maxSlice; i++ {
    		m.add(i, strconv.Itoa(i))
    	}
    	if m.m != nil {
    		t.Fatal("m.m != nil")
    	}
    	for i := 0; i < maxSlice; i++ {
    		g, _ := m.find(i)
    		w := strconv.Itoa(i)
    		if g != w {
    			t.Fatalf("%d: got %s, want %s", i, g, w)
    		}
    	}
    	m.add(4, "4")
    	if m.s != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 17:47:07 UTC 2023
    - 2.9K bytes
    - Viewed (0)
  10. platforms/software/dependency-management/src/integTest/groovy/org/gradle/integtests/resolve/transform/ArtifactTransformOfDirectoriesIntegrationTest.groovy

                }
                configurations {
                    compile
                }
                dependencies {
                    compile files(producer.output)
    
                    registerTransform(MakeSize) {
                        from.attribute(artifactType, 'directory')
                        to.attribute(artifactType, 'size')
                    }
                }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Oct 10 21:10:11 UTC 2023
    - 3.6K bytes
    - Viewed (0)
Back to top