| // Copyright 2014 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. |
| // Test that s[len(s):] - which can point past the end of the allocated block - |
| // does not confuse the garbage collector. |
| time.Sleep(10*time.Millisecond) |
| time.Sleep(10*time.Millisecond) |
| for i := 0; i < 10000; i++ { |
| runtime.SetFinalizer(t.ptr, func(**int) { panic("*int freed too early") }) |
| things = append(things, s[len(s):]) |
| things = append(things, Ts...) |