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