| // Copyright 2016 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. |
| c := make(chan []byte, 10) |
| c <- make([]byte, 10<<20) |
| c := make(chan []byte, 10) |
| c <- make([]byte, 10<<20) |
| func f1(c chan []byte, start int64) { |
| if delta := inuse() - start; delta < 9<<20 { |
| println("BUG: f1: after alloc: expected delta at least 9MB, got: ", delta) |
| if delta := inuse() - start; delta > 1<<20 { |
| println("BUG: f1: after alloc: expected delta below 1MB, got: ", delta) |
| func f2(c chan []byte, start int64) { |
| if delta := inuse() - start; delta < 9<<20 { |
| println("BUG: f2: after alloc: expected delta at least 9MB, got: ", delta) |
| if delta := inuse() - start; delta > 1<<20 { |
| println("BUG: f2: after alloc: expected delta below 1MB, got: ", delta) |
| runtime.ReadMemStats(&st) |