Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 397 for nalloc (0.23 sec)

  1. src/runtime/mfixalloc.go

    // Fixed-size object allocator. Returned memory is not zeroed.
    //
    // See malloc.go for overview.
    
    package runtime
    
    import (
    	"runtime/internal/sys"
    	"unsafe"
    )
    
    // fixalloc is a simple free-list allocator for fixed size objects.
    // Malloc uses a FixAlloc wrapped around sysAlloc to manage its
    // mcache and mspan objects.
    //
    // Memory returned by fixalloc.alloc is zeroed by default, but the
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 24 20:28:25 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  2. 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)
  3. src/runtime/mpagealloc_test.go

    			nAlloc := (PallocChunkPages * 4) / int(npages)
    			for i := 0; i < nAlloc; i++ {
    				addr := PageBase(BaseChunkIdx, uint(i)*uint(npages))
    				if a, _ := b.Alloc(npages); a != addr {
    					t.Fatalf("bad alloc #%d: want 0x%x, got 0x%x", i+1, addr, a)
    				}
    			}
    
    			// Check to make sure the next allocation fails.
    			if a, _ := b.Alloc(npages); a != 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 06 19:16:48 UTC 2021
    - 32.6K bytes
    - Viewed (0)
  4. 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)
  5. src/cmd/cgo/internal/testerrors/testdata/malloc.go

    	// causes it to fail.
    	if runtime.GOOS == "dragonfly" {
    		size = C.size_t(0x7fffffff << (32 * (^uintptr(0) >> 63)))
    	}
    
    	p := C.malloc(size)
    	if p == nil {
    		fmt.Println("malloc: C.malloc returned nil")
    		// Just exit normally--the test script expects this
    		// program to crash, so exiting normally indicates failure.
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 766 bytes
    - Viewed (0)
  6. 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)
  7. src/testing/allocs_test.go

    var global any
    
    var allocsPerRunTests = []struct {
    	name   string
    	fn     func()
    	allocs float64
    }{
    	{"alloc *byte", func() { global = new(*byte) }, 1},
    	{"alloc complex128", func() { global = new(complex128) }, 1},
    	{"alloc float64", func() { global = new(float64) }, 1},
    	{"alloc int32", func() { global = new(int32) }, 1},
    	{"alloc byte", func() { global = new(byte) }, 1},
    }
    
    func TestAllocsPerRun(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 817 bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/conc_alloc_test.go

    			}
    		} else if alloc >= item.upperBound {
    			if allocs[idx] != item.upperBound {
    				t.Fatalf("For requiredSum=%v, %s classes=%#+v got solution %v, %v in which item %d should be its upper bound but is not", requiredSum, style, classes, allocs, fairProp, idx)
    			}
    		} else if f64RelDiff(alloc, allocs[idx]) > fpSlack {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Nov 07 18:17:27 UTC 2022
    - 5.3K bytes
    - Viewed (0)
  9. platforms/documentation/docs/src/snippets/native-binaries/cunit/groovy/libs/cunit/2.1-2/include/CUnit/MyMem.h

    #else   /* MEMTRACE */
      /** Standard calloc() if MEMTRACE not defined. */
      #define CU_CALLOC(x, y)         calloc((x), (y))
      /** Standard malloc() if MEMTRACE not defined. */
      #define CU_MALLOC(x)            malloc((x))
      /** Standard free() if MEMTRACE not defined. */
      #define CU_FREE(x)              free((x))
      /** Standard realloc() if MEMTRACE not defined. */
      #define CU_REALLOC(x, y)        realloc((x), (y))
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 27 17:53:42 UTC 2023
    - 4K bytes
    - Viewed (0)
  10. 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)
Back to top