3 // Copyright 2014 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 that s[len(s):] - which can point past the end of the allocated block -
8 // does not confuse the garbage collector.
22 var things []interface{}
28 time.Sleep(10*time.Millisecond)
31 time.Sleep(10*time.Millisecond)
36 buf := make([]byte, 128)
38 for i := 0; i < 10000; i++ {
40 t := &T{ptr: new(*int)}
41 runtime.SetFinalizer(t.ptr, func(**int) { panic("*int freed too early") })
43 things = append(things, s[len(s):])
46 things = append(things, Ts...)