Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 397 for nalloc (0.12 sec)

  1. src/internal/reflectlite/all_test.go

    		}
    	}
    }
    
    func noAlloc(t *testing.T, n int, f func(int)) {
    	if testing.Short() {
    		t.Skip("skipping malloc count in short mode")
    	}
    	if runtime.GOMAXPROCS(0) > 1 {
    		t.Skip("skipping; GOMAXPROCS>1")
    	}
    	i := -1
    	allocs := testing.AllocsPerRun(n, func() {
    		f(i)
    		i++
    	})
    	if allocs > 0 {
    		t.Errorf("%d iterations: got %v mallocs, want 0", n, allocs)
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 16 19:26:08 UTC 2023
    - 24.2K bytes
    - Viewed (0)
  2. src/sort/search_test.go

    func TestSearchWrappersDontAlloc(t *testing.T) {
    	if testing.Short() {
    		t.Skip("skipping malloc count in short mode")
    	}
    	if runtime.GOMAXPROCS(0) > 1 {
    		t.Skip("skipping; GOMAXPROCS>1")
    	}
    	allocs := testing.AllocsPerRun(100, runSearchWrappers)
    	if allocs != 0 {
    		t.Errorf("expected no allocs for runSearchWrappers, got %v", allocs)
    	}
    }
    
    func BenchmarkSearchWrappers(b *testing.B) {
    	for i := 0; i < b.N; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 07 14:42:13 UTC 2022
    - 6.8K bytes
    - Viewed (0)
  3. 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)
  4. src/runtime/cgo/gcc_linux_amd64.c

    {
    	uintptr *pbounds;
    
    	/* The memory sanitizer distributed with versions of clang
    	   before 3.8 has a bug: if you call mmap before malloc, mmap
    	   may return an address that is later overwritten by the msan
    	   library.  Avoid this problem by forcing a call to malloc
    	   here, before we ever call malloc.
    
    	   This is only required for the memory sanitizer, so it's
    	   unfortunate that we always run it.  It should be possible
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 22 22:06:46 UTC 2023
    - 2.3K 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. 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)
  9. src/runtime/cgo/gcc_util.c

    	guards).
    	free(NULL) has a fast-path special case in TSAN, so it doesn't
    	trigger signal delivery.
    	free(malloc(0)) would work (triggering the interceptors in malloc), but
    	it also runs a bunch of user-supplied malloc hooks.
    
    	So we choose strncpy(_, _, 0): it requires an extra header,
    	but it's standard and should be very efficient.
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 16 18:49:38 UTC 2017
    - 1.8K bytes
    - Viewed (0)
  10. 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)
Back to top