3 // Copyright 2009 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 // Test basic operation of finalizers.
31 // the unused return is to test finalizers with return values
32 func finalA(a *A) (unused [N]int) {
34 println("finalA", a.n, final[a.n])
43 println("finalB", b.n, final[b.n])
56 for i = 0; i < N; i++ {
60 runtime.SetFinalizer(c, nofinalB)
61 runtime.SetFinalizer(b, finalB)
62 runtime.SetFinalizer(a, finalA)
63 runtime.SetFinalizer(c, nil)
65 for i := 0; i < N; i++ {
74 println("not enough finalizing:", nfinal, "/", N)