Search Options

Results per page
Sort
Preferred Languages
Advance

Results 61 - 70 of 195 for Malloc (0.12 sec)

  1. src/runtime/mpagecache.go

    		return c.base + i*pageSize, uintptr(scav) * pageSize
    	}
    	return c.allocN(npages)
    }
    
    // allocN is a helper which attempts to allocate npages worth of pages
    // from the cache. It represents the general case for allocating from
    // the page cache.
    //
    // Returns a base address and the amount of scavenged memory in the
    // allocated region in bytes.
    func (c *pageCache) allocN(npages uintptr) (uintptr, uintptr) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 19 14:30:00 UTC 2023
    - 5.6K bytes
    - Viewed (0)
  2. test/codegen/alloc.go

    Iskander Sharipov <******@****.***> 1546022404 +0300
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 26 23:08:15 UTC 2019
    - 902 bytes
    - Viewed (0)
  3. 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)
  4. 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)
  5. 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)
  6. src/testing/allocs.go

    	var memstats runtime.MemStats
    	runtime.ReadMemStats(&memstats)
    	mallocs := 0 - memstats.Mallocs
    
    	// Run the function the specified number of times
    	for i := 0; i < runs; i++ {
    		f()
    	}
    
    	// Read the final statistics
    	runtime.ReadMemStats(&memstats)
    	mallocs += memstats.Mallocs
    
    	// Average the mallocs over the runs (not counting the warm-up).
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 02 00:13:47 UTC 2016
    - 1.4K bytes
    - Viewed (0)
  7. src/runtime/mem_windows.go

    	// VirtualAlloc calls, and Windows will only let each VirtualFree handle pages from
    	// a single VirtualAlloc. It is okay to specify a subset of the pages from a single alloc,
    	// just not pages from multiple allocs. This is a rare case, arising only when we're
    	// trying to give memory back to the operating system, which happens on a time
    	// scale of minutes. It doesn't have to be terribly fast. Instead of extra bookkeeping
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 22 19:05:10 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/protobuf/protobuf_test.go

    				t.Fatal(err)
    			}
    
    			writer2 := &bytes.Buffer{}
    			alloc := &testAllocator{}
    			if err := target.EncodeWithAllocator(tc.obj, writer2, alloc); err != nil {
    				t.Fatal(err)
    			}
    			if alloc.allocateCount != 1 {
    				t.Fatalf("expected the Allocate method to be called exactly 1 but it was executed: %v times ", alloc.allocateCount)
    			}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jul 27 03:17:50 UTC 2022
    - 5K bytes
    - Viewed (0)
  9. test/chan/select2.go

    	runtime.ReadMemStats(memstats)
    	alloc := memstats.Alloc
    
    	// second time shouldn't increase footprint by much
    	go sender(c, 100000)
    	receiver(c, dummy, 100000)
    	runtime.GC()
    	runtime.ReadMemStats(memstats)
    
    	// Be careful to avoid wraparound.
    	if memstats.Alloc > alloc && memstats.Alloc-alloc > 1.1e5 {
    		println("BUG: too much memory for 100,000 selects:", memstats.Alloc-alloc)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 1K bytes
    - Viewed (0)
  10. test/escape4.go

    package foo
    
    var p *int
    
    func alloc(x int) *int { // ERROR "can inline alloc" "moved to heap: x"
    	return &x
    }
    
    var f func()
    
    func f1() {
    	p = alloc(2) // ERROR "inlining call to alloc" "moved to heap: x"
    
    	// Escape analysis used to miss inlined code in closures.
    
    	func() { // ERROR "can inline f1.func1"
    		p = alloc(3) // ERROR "inlining call to alloc"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 14 19:43:26 UTC 2023
    - 1.4K bytes
    - Viewed (0)
Back to top