Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 262 for mheap (0.04 sec)

  1. test/escape_level.go

    var sink interface{}
    
    func level0() {
    	i := 0     // ERROR "moved to heap: i"
    	p0 := &i   // ERROR "moved to heap: p0"
    	p1 := &p0  // ERROR "moved to heap: p1"
    	p2 := &p1  // ERROR "moved to heap: p2"
    	sink = &p2
    }
    
    func level1() {
    	i := 0    // ERROR "moved to heap: i"
    	p0 := &i  // ERROR "moved to heap: p0"
    	p1 := &p0 // ERROR "moved to heap: p1"
    	p2 := &p1
    	sink = p2
    }
    
    func level2() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 03 17:52:06 UTC 2019
    - 1.8K bytes
    - Viewed (0)
  2. src/cmd/link/internal/ld/heap_test.go

    			}
    			h.pop()
    			if !verify(&h, 0) {
    				t.Errorf("heap invariant violated: %v", h)
    			}
    		}
    		for !h.empty() { // pop remaining elements
    			h.pop()
    			if !verify(&h, 0) {
    				t.Errorf("heap invariant violated: %v", h)
    			}
    		}
    	}
    }
    
    // recursively verify heap-ness, starting at element i.
    func verify(h *heap, i int) bool {
    	n := len(*h)
    	c1 := 2*i + 1 // left child
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 04 19:13:42 UTC 2020
    - 1.9K bytes
    - Viewed (0)
  3. test/escape_map.go

    	i := 0                   // ERROR "moved to heap: i"
    	j := 0                   // ERROR "moved to heap: j"
    	m[&i] = &j
    	return m
    }
    
    func map3() []*int {
    	m := make(map[*int]*int) // ERROR "make\(map\[\*int\]\*int\) does not escape"
    	i := 0                   // ERROR "moved to heap: i"
    	// BAD: j should not escape
    	j := 0 // ERROR "moved to heap: j"
    	m[&i] = &j
    	var r []*int
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Sep 12 08:31:49 UTC 2020
    - 2.8K bytes
    - Viewed (0)
  4. test/escape_param.go

    	p := &i // ERROR "moved to heap: p$"
    	p2 := &p
    	param6(&p2)
    }
    
    // **in -> heap
    func param7(i ***int) { // ERROR "leaking param content: i$"
    	sink = **i
    }
    
    func caller7() {
    	i := 0 // ERROR "moved to heap: i$"
    	p := &i
    	p2 := &p
    	param7(&p2)
    }
    
    // **in -> heap
    func param8(i **int) { // ERROR "i does not escape$"
    	sink = **i // ERROR "\*\(\*i\) escapes to heap"
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 26 23:50:32 UTC 2021
    - 8.9K bytes
    - Viewed (0)
  5. test/escape_field.go

    	x X
    }
    
    func field0() {
    	i := 0 // ERROR "moved to heap: i$"
    	var x X
    	x.p1 = &i
    	sink = x.p1
    }
    
    func field1() {
    	i := 0 // ERROR "moved to heap: i$"
    	var x X
    	// BAD: &i should not escape
    	x.p1 = &i
    	sink = x.p2
    }
    
    func field3() {
    	i := 0 // ERROR "moved to heap: i$"
    	var x X
    	x.p1 = &i
    	sink = x // ERROR "x escapes to heap"
    }
    
    func field4() {
    	i := 0 // ERROR "moved to heap: i$"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Sep 12 08:31:49 UTC 2020
    - 2.9K bytes
    - Viewed (0)
  6. test/escape_slice.go

    	i := 0 // ERROR "moved to heap: i"
    	s = append(s, &i)
    	_ = s
    }
    
    func slice1() *int {
    	var s []*int
    	i := 0 // ERROR "moved to heap: i"
    	s = append(s, &i)
    	return s[0]
    }
    
    func slice2() []*int {
    	var s []*int
    	i := 0 // ERROR "moved to heap: i"
    	s = append(s, &i)
    	return s
    }
    
    func slice3() *int {
    	var s []*int
    	i := 0 // ERROR "moved to heap: i"
    	s = append(s, &i)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 18:50:24 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  7. test/uintptrescapes2.go

    	var v int                         // ERROR "moved to heap"
    	t.M1(uintptr(unsafe.Pointer(&v))) // ERROR "live at call to T.M1: .?autotmp" "stack object .autotmp_[0-9]+ unsafe.Pointer$"
    }
    
    func TestF2() {
    	var v int                                 // ERROR "moved to heap"
    	F2(0, 1, uintptr(unsafe.Pointer(&v)), 2)  // ERROR "live at call to newobject: .?autotmp" "live at call to F2: .?autotmp" "escapes to heap" "stack object .autotmp_[0-9]+ unsafe.Pointer$"
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 24 18:24:24 UTC 2021
    - 2.2K bytes
    - Viewed (0)
  8. test/fixedbugs/issue12006.go

    	for i := 0; i < 1000; i++ {
    		var i, j, k int   // ERROR "moved to heap: i" "moved to heap: j" "moved to heap: k"
    		FooNx(&k, &i, &j) // ERROR "... argument does not escape"
    	}
    }
    
    func TFooNy() {
    	for i := 0; i < 1000; i++ {
    		var i, j, k int   // ERROR "moved to heap: i" "moved to heap: j" "moved to heap: k"
    		FooNy(&k, &i, &j) // ERROR "... argument escapes to heap"
    	}
    }
    
    func TFooNz() {
    	for i := 0; i < 1000; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 26 23:50:32 UTC 2021
    - 3.8K bytes
    - Viewed (0)
  9. src/container/heap/example_intheap_test.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // This example demonstrates an integer heap built using the heap interface.
    package heap_test
    
    import (
    	"container/heap"
    	"fmt"
    )
    
    // An IntHeap is a min-heap of ints.
    type IntHeap []int
    
    func (h IntHeap) Len() int           { return len(h) }
    func (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 1.1K bytes
    - Viewed (0)
  10. test/escape_iface.go

    	}
    	{
    		i := 0       // ERROR "moved to heap: i"
    		v := &M2{&i} // ERROR "&M2{...} escapes to heap"
    		var x M = v
    		sink = x
    	}
    	{
    		i := 0
    		v := &M2{&i} // ERROR "&M2{...} does not escape"
    		var x M = v
    		v1 := x.(*M2)
    		_ = v1
    	}
    	{
    		i := 0       // ERROR "moved to heap: i"
    		v := &M2{&i} // ERROR "&M2{...} escapes to heap"
    		// BAD: v does not escape to heap here
    		var x M = v
    		v1 := x.(*M2)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 23 17:16:35 UTC 2023
    - 4.5K bytes
    - Viewed (0)
Back to top