Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 20 for newElems (0.18 sec)

  1. src/internal/fuzz/queue.go

    	return len(q.elems)
    }
    
    func (q *queue) grow() {
    	oldCap := q.cap()
    	newCap := oldCap * 2
    	if newCap == 0 {
    		newCap = 8
    	}
    	newElems := make([]any, newCap)
    	oldLen := q.len
    	for i := 0; i < oldLen; i++ {
    		newElems[i] = q.elems[(q.head+i)%oldCap]
    	}
    	q.elems = newElems
    	q.head = 0
    }
    
    func (q *queue) enqueue(e any) {
    	if q.len+1 > q.cap() {
    		q.grow()
    	}
    	i := (q.head + q.len) % q.cap()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Nov 05 21:02:45 UTC 2022
    - 1.5K bytes
    - Viewed (0)
  2. pkg/controller/nodelifecycle/node_lifecycle_controller_test.go

    		},
    	}
    }
    
    func (nc *nodeLifecycleController) syncLeaseStore(lease *coordv1.Lease) error {
    	if lease == nil {
    		return nil
    	}
    	newElems := make([]interface{}, 0, 1)
    	newElems = append(newElems, lease)
    	return nc.leaseInformer.Informer().GetStore().Replace(newElems, "newRV")
    }
    
    func (nc *nodeLifecycleController) syncNodeStore(fakeNodeHandler *testutil.FakeNodeHandler) error {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Feb 26 03:26:45 UTC 2024
    - 119K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured_list.go

    	unstructuredItems := make([]Unstructured, 0, len(items))
    	newItems := make([]interface{}, 0, len(items))
    	for _, item := range items {
    		o, ok := item.(map[string]interface{})
    		if !ok {
    			continue
    		}
    		unstructuredItems = append(unstructuredItems, Unstructured{Object: o})
    		newItems = append(newItems, o)
    	}
    	obj.Items = unstructuredItems
    	obj.Object["items"] = newItems
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun May 28 04:46:35 UTC 2023
    - 6.3K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/model/adaptor.go

    // validations, and doesn't cost too much since since we are usually exploring the
    // entire schema anyway.
    func nestedValueValidationToStructural(nvv *schema.NestedValueValidation) *Structural {
    	var newItems *schema.Structural
    	if nvv.Items != nil {
    		newItems = nestedValueValidationToStructural(nvv.Items).Structural
    	}
    
    	var newProperties map[string]schema.Structural
    	for k, v := range nvv.Properties {
    		if newProperties == nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 16 20:13:14 UTC 2024
    - 8.2K bytes
    - Viewed (0)
  5. src/runtime/mcentral.go

    havespan:
    	if !traceDone {
    		trace := traceAcquire()
    		if trace.ok() {
    			trace.GCSweepDone()
    			traceRelease(trace)
    		}
    	}
    	n := int(s.nelems) - int(s.allocCount)
    	if n == 0 || s.freeindex == s.nelems || s.allocCount == s.nelems {
    		throw("span has no free objects")
    	}
    	freeByteBase := s.freeindex &^ (64 - 1)
    	whichByte := freeByteBase / 8
    	// Init alloc bits cache.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  6. src/runtime/mgcsweep.go

    		// more detail.
    		print("runtime: nelems=", s.nelems, " nalloc=", nalloc, " previous allocCount=", s.allocCount, " nfreed=", nfreed, "\n")
    		throw("sweep increased allocation count")
    	}
    
    	s.allocCount = nalloc
    	s.freeindex = 0 // reset allocation index to start of span.
    	s.freeIndexForScan = 0
    	if traceEnabled() {
    		getg().m.p.ptr().trace.reclaimed += uintptr(nfreed) * s.elemsize
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:52:18 UTC 2024
    - 32.9K bytes
    - Viewed (0)
  7. tensorflow/c/tf_tensor.cc

                                  const tensorflow::TensorShape& shape) {
      static char empty;
      int64_t nelems = 1;
      std::vector<int64_t> dims;
      auto shape_dims = shape.dims();
      dims.reserve(shape_dims);
      for (int i = 0; i < shape_dims; ++i) {
        dims.push_back(shape.dim_size(i));
        nelems *= shape.dim_size(i);
      }
      CHECK_EQ(nelems, 0);
      return TF_NewTensor(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sun Apr 14 21:57:32 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  8. src/runtime/malloc.go

    	freeIndex := s.nextFreeIndex()
    	if freeIndex == s.nelems {
    		// The span is full.
    		if s.allocCount != s.nelems {
    			println("runtime: s.allocCount=", s.allocCount, "s.nelems=", s.nelems)
    			throw("s.allocCount != s.nelems && freeIndex == s.nelems")
    		}
    		c.refill(spc)
    		shouldhelpgc = true
    		s = c.alloc[spc]
    
    		freeIndex = s.nextFreeIndex()
    	}
    
    	if freeIndex >= s.nelems {
    		throw("freeIndex is not valid")
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 59.6K bytes
    - Viewed (0)
  9. src/runtime/pinner.go

    func (s *mspan) pinnerBitSize() uintptr {
    	return divRoundUp(uintptr(s.nelems)*2, 8)
    }
    
    // newPinnerBits returns a pointer to 8 byte aligned bytes to be used for this
    // span's pinner bits. newPinnerBits is used to mark objects that are pinned.
    // They are copied when the span is swept.
    func (s *mspan) newPinnerBits() *pinnerBits {
    	return (*pinnerBits)(newMarkBits(uintptr(s.nelems) * 2))
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 11K bytes
    - Viewed (0)
  10. src/runtime/mcache.go

    // c could change.
    func (c *mcache) refill(spc spanClass) {
    	// Return the current cached span to the central lists.
    	s := c.alloc[spc]
    
    	if s.allocCount != s.nelems {
    		throw("refill of span with free space remaining")
    	}
    	if s != &emptymspan {
    		// Mark this span as no longer cached.
    		if s.sweepgen != mheap_.sweepgen+3 {
    			throw("bad sweepgen in refill")
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 10K bytes
    - Viewed (0)
Back to top