3 // Copyright 2023 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.
15 func g(x *byte) *byte { return x }
19 str("AAAAAAAA", "BBBBBBBBB")
22 func wait(done <-chan struct{}) bool {
23 for i := 0; i < 10; i++ {
35 s := make([]byte, 100)
37 one := unsafe.SliceData(s)
39 done := make(chan struct{})
40 runtime.SetFinalizer(one, func(*byte) { close(done) })
57 var strDone = make(chan struct{})
60 func str(x, y string) {
61 s := x + y // put in temporary on stack
62 p := unsafe.StringData(s)
63 runtime.SetFinalizer(p, func(*byte) { close(strDone) })