3 // Copyright 2020 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.
7 // This test makes sure unsafe-uintptr arguments are not
8 // kept alive longer than expected.
17 var done = make(chan bool)
19 func setup() unsafe.Pointer {
21 runtime.SetFinalizer(&s, func(p *string) { close(done) })
22 return unsafe.Pointer(&s)
27 func before(p uintptr) int {
45 _ = before(uintptr(setup())) + after()