3 // Copyright 2018 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
14 // linked list up the stack, to test lots of stack objects.
17 // points to a heap object. Test will make sure it isn't freed.
19 // next pointer for a linked list of stack objects
21 // duplicate of next, to stress test the pointer buffers
22 // used during stack tracing.
30 func makelist(x *T, n int64) {
32 panic("must be multiple of 2")
37 for ; x != nil; x, i = x.next, i+1 {
38 // Make sure x.data hasn't been collected.
39 if got := *x.data; got != i {
40 panic(fmt.Sprintf("bad data want %d, got %d", i, got))
45 // Put 2 objects in each frame, to test intra-frame pointers.
46 // Use both orderings to ensure the linked list isn't always in address order.
52 b.data = newInt(n - 1)
60 a.data = newInt(n - 1)
69 // big enough and pointer-y enough to not be tinyalloc'd
75 // newInt allocates n on the heap and returns a pointer to it.
76 func newInt(n int64) *int64 {