Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 468 for heapUp (0.32 sec)

  1. src/internal/trace/internal/oldtrace/order.go

    }
    
    func (h *orderEventList) Push(x orderEvent) {
    	*h = append(*h, x)
    	heapUp(h, len(*h)-1)
    }
    
    func (h *orderEventList) Pop() orderEvent {
    	n := len(*h) - 1
    	(*h)[0], (*h)[n] = (*h)[n], (*h)[0]
    	heapDown(h, 0, n)
    	x := (*h)[len(*h)-1]
    	*h = (*h)[:len(*h)-1]
    	return x
    }
    
    func heapUp(h *orderEventList, j int) {
    	for {
    		i := (j - 1) / 2 // parent
    		if i == j || !h.Less(j, i) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 4K bytes
    - Viewed (0)
  2. src/container/heap/heap.go

    // Package heap provides heap operations for any type that implements
    // heap.Interface. A heap is a tree with the property that each node is the
    // minimum-valued node in its subtree.
    //
    // The minimum element in the tree is the root, at index 0.
    //
    // A heap is a common way to implement a priority queue. To build a priority
    // queue, implement the Heap interface with the (negative) priority as the
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 12 14:39:10 UTC 2023
    - 3.3K bytes
    - Viewed (0)
  3. pkg/scheduler/internal/heap/heap.go

    	return h.data.Peek()
    }
    
    // Pop returns the head of the heap and removes it.
    func (h *Heap) Pop() (interface{}, error) {
    	obj := heap.Pop(h.data)
    	if obj != nil {
    		if h.metricRecorder != nil {
    			h.metricRecorder.Dec()
    		}
    		return obj, nil
    	}
    	return nil, fmt.Errorf("object was removed from heap data")
    }
    
    // Get returns the requested item, or sets exists=false.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Apr 29 18:37:35 UTC 2022
    - 6.7K bytes
    - Viewed (0)
  4. src/cmd/link/internal/ld/heap.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package ld
    
    import "cmd/link/internal/loader"
    
    // Min-heap implementation, for the deadcode pass.
    // Specialized for loader.Sym elements.
    
    type heap []loader.Sym
    
    func (h *heap) push(s loader.Sym) {
    	*h = append(*h, s)
    	// sift up
    	n := len(*h) - 1
    	for n > 0 {
    		p := (n - 1) / 2 // parent
    		if (*h)[p] <= (*h)[n] {
    			break
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 14 16:55:22 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  5. src/runtime/mgc.go

    	// when stopping began (just before trying to stop Ps) and just after the
    	// world started again.
    	pauseNS int64
    
    	// debug.gctrace heap sizes for this cycle.
    	heap0, heap1, heap2 uint64
    
    	// Cumulative estimated CPU usage.
    	cpuStats
    }
    
    // GC runs a garbage collection and blocks the caller until the
    // garbage collection is complete. It may also block the entire
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 16:25:21 UTC 2024
    - 62K bytes
    - Viewed (0)
  6. src/runtime/mgcpacer.go

    	}
    
    	// For small heaps, set the max trigger point at maxTriggerRatio of the way
    	// from the live heap to the heap goal. This ensures we always have *some*
    	// headroom when the GC actually starts. For larger heaps, set the max trigger
    	// point at the goal, minus the minimum heap size.
    	//
    	// This choice follows from the fact that the minimum heap size is chosen
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 55.4K bytes
    - Viewed (0)
  7. src/sync/atomic/value_test.go

    			g.Done()
    		}()
    	}
    	g.Wait()
    	if want, got := (m*n-1)*(m*n)/2, count+v.Load().(uint64); got != want {
    		t.Errorf("sum from 0 to %d was %d, want %v", m*n-1, got, want)
    	}
    }
    
    var heapA, heapB = struct{ uint }{0}, struct{ uint }{0}
    
    var Value_CompareAndSwapTests = []struct {
    	init any
    	new  any
    	old  any
    	want bool
    	err  any
    }{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 6.1K bytes
    - Viewed (0)
  8. src/cmd/vendor/github.com/google/pprof/profile/legacy_java_profile.go

    		PeriodType: &ValueType{},
    	}
    	header := string(bytes.TrimSpace(h[0]))
    
    	var err error
    	var pType string
    	switch header {
    	case "--- heapz 1 ---":
    		pType = "heap"
    	case "--- contentionz 1 ---":
    		pType = "contention"
    	default:
    		return nil, errUnrecognized
    	}
    
    	if b, err = parseJavaHeader(pType, h[1], p); err != nil {
    		return nil, err
    	}
    	var locs map[uint64]*Location
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 16 15:19:53 UTC 2024
    - 8.8K bytes
    - Viewed (0)
  9. src/runtime/time.go

    	}
    	if heap[i].timer != tw.timer {
    		heap[i] = tw
    	}
    }
    
    // siftDown puts the timer at position i in the right place
    // in the heap by moving it down toward the bottom of the heap.
    func (ts *timers) siftDown(i int) {
    	heap := ts.heap
    	n := len(heap)
    	if i >= n {
    		badTimer()
    	}
    	if i*timerHeapN+1 >= n {
    		return
    	}
    	tw := heap[i]
    	when := tw.when
    	if when <= 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 29 14:36:24 UTC 2024
    - 37.5K bytes
    - Viewed (0)
  10. src/runtime/malloc.go

    	// be very high if they were to be backed by huge pages (e.g. a few MiB makes
    	// a huge difference for an 8 MiB heap, but barely any difference for a 1 GiB
    	// heap). The benefit of huge pages is also not worth it for small heaps,
    	// because only a very, very small part of the metadata is used for small heaps.
    	//
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 59.6K bytes
    - Viewed (0)
Back to top