| // $G $D/$F.go && $L $F.$A && ./$A.out |
| // Copyright 2010 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. |
| func sender(c chan int, n int) { |
| func receiver(c, dummy chan int, n int) { |
| runtime.MemProfileRate = 0 |
| receiver(c, dummy, 100000) |
| runtime.MemStats.Alloc = 0 |
| // second time shouldn't increase footprint by much |
| receiver(c, dummy, 100000) |
| if runtime.MemStats.Alloc > 1e5 { |
| println("BUG: too much memory for 100,000 selects:", runtime.MemStats.Alloc) |