Russ Cox | e29ce17 | 2008-12-18 15:42:28 -0800 | [diff] [blame] | 1 | // $G $D/$F.go && $L $F.$A && ./$A.out |
| 2 | |
| 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 | |
| 7 | // trivial malloc test |
| 8 | |
| 9 | package main |
| 10 | |
| 11 | import ( |
Russ Cox | 33e396a | 2010-02-03 16:31:34 -0800 | [diff] [blame] | 12 | "flag" |
| 13 | "fmt" |
| 14 | "runtime" |
Russ Cox | e29ce17 | 2008-12-18 15:42:28 -0800 | [diff] [blame] | 15 | ) |
| 16 | |
Russ Cox | 33e396a | 2010-02-03 16:31:34 -0800 | [diff] [blame] | 17 | var chatty = flag.Bool("v", false, "chatty") |
Russ Cox | e29ce17 | 2008-12-18 15:42:28 -0800 | [diff] [blame] | 18 | |
| 19 | func main() { |
Russ Cox | 33e396a | 2010-02-03 16:31:34 -0800 | [diff] [blame] | 20 | runtime.Free(runtime.Alloc(1)) |
Rob Pike | c45d2a7 | 2009-01-09 13:42:46 -0800 | [diff] [blame] | 21 | if *chatty { |
Russ Cox | 33e396a | 2010-02-03 16:31:34 -0800 | [diff] [blame] | 22 | fmt.Printf("%+v %v\n", runtime.MemStats, uint64(0)) |
Russ Cox | e29ce17 | 2008-12-18 15:42:28 -0800 | [diff] [blame] | 23 | } |
| 24 | } |