Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 205 for nalloc (0.12 sec)

  1. src/runtime/mgcsweep.go

    				s.reportZombies()
    			}
    		}
    	}
    
    	// Count the number of free objects in this span.
    	nalloc := uint16(s.countAlloc())
    	nfreed := s.allocCount - nalloc
    	if nalloc > s.allocCount {
    		// The zombie check above should have caught this in
    		// more detail.
    		print("runtime: nelems=", s.nelems, " nalloc=", nalloc, " previous allocCount=", s.allocCount, " nfreed=", nfreed, "\n")
    		throw("sweep increased allocation count")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:52:18 UTC 2024
    - 32.9K bytes
    - Viewed (0)
  2. src/runtime/malloc.go

    			minSizeForMallocHeaderIsSizeClass = true
    			break
    		}
    	}
    	if !minSizeForMallocHeaderIsSizeClass {
    		throw("min size of malloc header is not a size class boundary")
    	}
    	// Check that the pointer bitmap for all small sizes without a malloc header
    	// fits in a word.
    	if minSizeForMallocHeader/goarch.PtrSize > 8*goarch.PtrSize {
    		throw("max pointer/scan bitmap size for headerless objects is too large")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 59.6K bytes
    - Viewed (0)
  3. src/runtime/mcache.go

    var emptymspan mspan
    
    func allocmcache() *mcache {
    	var c *mcache
    	systemstack(func() {
    		lock(&mheap_.lock)
    		c = (*mcache)(mheap_.cachealloc.alloc())
    		c.flushGen.Store(mheap_.sweepgen)
    		unlock(&mheap_.lock)
    	})
    	for i := range c.alloc {
    		c.alloc[i] = &emptymspan
    	}
    	c.nextSample = nextSample()
    	return c
    }
    
    // freemcache releases resources associated with this
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 10K bytes
    - Viewed (0)
  4. src/runtime/mstats.go

    		// Size is the maximum byte size of an object in this
    		// size class.
    		Size uint32
    
    		// Mallocs is the cumulative count of heap objects
    		// allocated in this size class. The cumulative bytes
    		// of allocation is Size*Mallocs. The number of live
    		// objects in this size class is Mallocs - Frees.
    		Mallocs uint64
    
    		// Frees is the cumulative count of heap objects freed
    		// in this size class.
    		Frees uint64
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 08 21:03:13 UTC 2024
    - 34.2K bytes
    - Viewed (0)
  5. src/runtime/mpallocbits.go

    	return (*pageBits)(b).block64(i)
    }
    
    // allocPages64 allocates a 64-bit block of 64 pages aligned to 64 pages according
    // to the bits set in alloc. The block set is the one containing the i'th page.
    func (b *pallocBits) allocPages64(i uint, alloc uint64) {
    	(*pageBits)(b).setBlock64(i, alloc)
    }
    
    // findBitRange64 returns the bit index of the first set of
    // n consecutive 1 bits. If no consecutive set of 1 bits of
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat May 18 15:13:43 UTC 2024
    - 12.5K bytes
    - Viewed (0)
  6. src/runtime/metrics_test.go

    		t.Error("allocs-by-size and frees-by-size counts don't match in length")
    	} else {
    		for i := range objects.alloc.Buckets {
    			ba := objects.alloc.Buckets[i]
    			bf := objects.free.Buckets[i]
    			if ba != bf {
    				t.Errorf("bucket %d is different for alloc and free hists: %f != %f", i, ba, bf)
    			}
    		}
    		if !t.Failed() {
    			var gotAlloc, gotFree uint64
    			want := objects.total
    			for i := range objects.alloc.Counts {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:52:17 UTC 2024
    - 45K bytes
    - Viewed (0)
  7. src/strings/builder_test.go

    		}
    	})
    }
    
    func TestBuilderGrowSizeclasses(t *testing.T) {
    	s := Repeat("a", 19)
    	allocs := testing.AllocsPerRun(100, func() {
    		var b Builder
    		b.Grow(18)
    		b.WriteString(s)
    		_ = b.String()
    	})
    	if allocs > 1 {
    		t.Fatalf("unexpected amount of allocations: %v, want: 1", allocs)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 19 19:51:15 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  8. src/runtime/pprof/protomem_test.go

    		}
    	}
    }
    
    type opAlloc struct {
    	buf [128]byte
    }
    
    type opCall struct {
    }
    
    var sink []byte
    
    func storeAlloc() {
    	sink = make([]byte, 16)
    }
    
    func nonRecursiveGenericAllocFunction[CurrentOp any, OtherOp any](alloc bool) {
    	if alloc {
    		storeAlloc()
    	} else {
    		nonRecursiveGenericAllocFunction[OtherOp, CurrentOp](true)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 21 14:38:45 UTC 2024
    - 6.7K bytes
    - Viewed (0)
  9. src/log/slog/value_test.go

    		tm = TimeValue(testTime).Time()
    		x = AnyValue(p).Any()
    	}))
    	if a != 0 {
    		t.Errorf("got %d allocs, want zero", a)
    	}
    	_ = u
    	_ = f
    	_ = b
    	_ = s
    	_ = x
    	_ = tm
    }
    
    func TestAnyLevelAlloc(t *testing.T) {
    	// Because typical Levels are small integers,
    	// they are zero-alloc.
    	var a Value
    	x := LevelDebug + 100
    	wantAllocs(t, 0, func() { a = AnyValue(x) })
    	_ = a
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 16:12:08 UTC 2024
    - 6.9K bytes
    - Viewed (0)
  10. src/runtime/mpagealloc.go

    // space into chunks.
    type chunkIdx uint
    
    // chunkIndex returns the global index of the palloc chunk containing the
    // pointer p.
    func chunkIndex(p uintptr) chunkIdx {
    	return chunkIdx((p - arenaBaseOffset) / pallocChunkBytes)
    }
    
    // chunkBase returns the base address of the palloc chunk at index ci.
    func chunkBase(ci chunkIdx) uintptr {
    	return uintptr(ci)*pallocChunkBytes + arenaBaseOffset
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 39.2K bytes
    - Viewed (0)
Back to top