Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 236 for heapUp (0.13 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/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)
  6. 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)
  7. testing/soak/src/integTest/kotlin/org/gradle/kotlin/dsl/caching/AbstractScriptCachingIntegrationTest.kt

            executerForCacheInspection(*arguments).run()
    
        protected
        fun buildWithDaemonHeapSize(heapMb: Int, vararg arguments: String): ExecutionResult =
            executerForCacheInspection(*arguments)
                .withBuildJvmOpts("-Xms${heapMb}m", "-Xmx${heapMb}m")
                .run()
    
        private
        fun executerForCacheInspection(vararg arguments: String): GradleExecuter =
            gradleExecuterFor(
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Jun 07 11:33:23 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  8. test/fixedbugs/issue13799.go

    	// Heap -> stack pointer eventually causes badness when stack reallocation
    	// occurs.
    
    	var fn func() // ERROR "moved to heap: fn$"
    	i := 0        // ERROR "moved to heap: i$"
    	for ; i < maxI; i++ {
    		// var fn func() // this makes it work, because fn stays off heap
    		j := 0        // ERROR "moved to heap: j$"
    		fn = func() { // ERROR "func literal escapes to heap$"
    			m[i] = append(m[i], 0)
    			if j < 25 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 18:50:24 UTC 2023
    - 4.9K bytes
    - Viewed (0)
  9. test/escape_indir.go

    	x := &ConstPtr{} // ERROR "&ConstPtr{} does not escape"
    	x.p = &i
    	return *x
    }
    
    func constptr03() **ConstPtr {
    	i := 0           // ERROR "moved to heap: i"
    	x := &ConstPtr{} // ERROR "&ConstPtr{} escapes to heap" "moved to heap: x"
    	x.p = &i
    	return &x
    }
    
    func constptr1() {
    	i := 0           // ERROR "moved to heap: i"
    	x := &ConstPtr{} // ERROR "&ConstPtr{} escapes to heap"
    	x.p = &i
    	sink = x
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Sep 12 08:31:49 UTC 2020
    - 3.3K bytes
    - Viewed (0)
  10. src/internal/trace/batchcursor_test.go

    	heap[len(heap)-1].ev.time = 21
    	heapUpdate(heap, len(heap)-1)
    	checkHeap(t, heap)
    	if heap[len(heap)-1].ev.time != 21 {
    		t.Fatalf("heap update failed, expected %d as heap min: %s", 21, heapDebugString(heap))
    	}
    
    	// Update the last element to be smaller.
    	heap[len(heap)-1].ev.time = 7
    	heapUpdate(heap, len(heap)-1)
    	checkHeap(t, heap)
    	if heap[len(heap)-1].ev.time == 21 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 3K bytes
    - Viewed (0)
Back to top