Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for heapDiff (0.09 sec)

  1. src/image/gif/reader_test.go

    	runtime.ReadMemStats(s0)
    	if _, err := Decode(buf); err != nil {
    		t.Fatal("Decode:", err)
    	}
    	runtime.ReadMemStats(s1)
    	if heapDiff := int64(s1.HeapAlloc - s0.HeapAlloc); heapDiff > 30<<20 {
    		t.Fatalf("Decode of %d frames increased heap by %dMB", frames, heapDiff>>20)
    	}
    }
    
    func BenchmarkDecode(b *testing.B) {
    	data, err := os.ReadFile("../testdata/video-001.gif")
    	if err != nil {
    		b.Fatal(err)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 11 16:15:54 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  2. src/container/heap/heap.go

    // Init is idempotent with respect to the heap invariants
    // and may be called whenever the heap invariants may have been invalidated.
    // The complexity is O(n) where n = h.Len().
    func Init(h Interface) {
    	// heapify
    	n := h.Len()
    	for i := n/2 - 1; i >= 0; i-- {
    		down(h, i, n)
    	}
    }
    
    // Push pushes the element x onto the heap.
    // The complexity is O(log n) where n = h.Len().
    func Push(h Interface, x any) {
    	h.Push(x)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 12 14:39:10 UTC 2023
    - 3.3K bytes
    - Viewed (0)
Back to top