blob: 146976467b01338cf4da81f4f6e4fea44f00df68 [file] [log] [blame]
Russ Coxe29ce172008-12-18 15:42:28 -08001// $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
9package main
10
11import (
Russ Cox33e396a2010-02-03 16:31:34 -080012 "flag"
13 "fmt"
14 "runtime"
Russ Coxe29ce172008-12-18 15:42:28 -080015)
16
Russ Cox33e396a2010-02-03 16:31:34 -080017var chatty = flag.Bool("v", false, "chatty")
Russ Coxe29ce172008-12-18 15:42:28 -080018
19func main() {
Russ Cox33e396a2010-02-03 16:31:34 -080020 runtime.Free(runtime.Alloc(1))
Rob Pikec45d2a72009-01-09 13:42:46 -080021 if *chatty {
Russ Cox33e396a2010-02-03 16:31:34 -080022 fmt.Printf("%+v %v\n", runtime.MemStats, uint64(0))
Russ Coxe29ce172008-12-18 15:42:28 -080023 }
24}