blob: e610d2bde810464bfb0fd2547b44bd6893d5da2d [file] [log] [blame]
Russ Coxd2cc9882012-02-16 23:50:37 -05001// run
Russ Cox1ce17912009-01-26 17:37:05 -08002
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.
6
7package main
8
Russ Cox33e396a2010-02-03 16:31:34 -08009import "runtime"
Russ Cox1ce17912009-01-26 17:37:05 -080010
11func mk2() {
Russ Cox33e396a2010-02-03 16:31:34 -080012 b := new([10000]byte)
13 _ = b
Rob Pike4f61fc92010-09-04 10:36:13 +100014 // println(b, "stored at", &b)
Russ Cox1ce17912009-01-26 17:37:05 -080015}
16
Russ Cox33e396a2010-02-03 16:31:34 -080017func mk1() { mk2() }
Russ Cox1ce17912009-01-26 17:37:05 -080018
19func main() {
20 for i := 0; i < 10; i++ {
Russ Cox33e396a2010-02-03 16:31:34 -080021 mk1()
22 runtime.GC()
Russ Cox1ce17912009-01-26 17:37:05 -080023 }
24}