go/test/malloc1.go
Rob Pike 61f3302044 printf->Printf etc.
the raw fmt routines will be another, smaller but subtler pass.

R=rsc
DELTA=157  (0 added, 0 deleted, 157 changed)
OCL=22851
CL=22851
2009-01-15 13:48:11 -08:00

26 lines
447 B
Go

// $G $D/$F.go && $L $F.$A && ./$A.out
// Copyright 2009 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.
// trivial malloc test
package main
import (
"flag";
"fmt";
"malloc";
)
var chatty = flag.Bool("v", false, "chatty");
func main() {
malloc.Free(malloc.Alloc(1));
if *chatty {
fmt.Printf("%+v %v\n", *malloc.GetStats(), uint64(0));
}
}