2008-12-18 16:42:28 -07:00
|
|
|
// $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";
|
|
|
|
)
|
|
|
|
|
2009-01-09 14:42:46 -07:00
|
|
|
var chatty = flag.Bool("v", false, "chatty");
|
2008-12-18 16:42:28 -07:00
|
|
|
|
|
|
|
func main() {
|
|
|
|
malloc.Free(malloc.Alloc(1));
|
2009-01-09 14:42:46 -07:00
|
|
|
if *chatty {
|
2009-01-15 14:48:11 -07:00
|
|
|
fmt.Printf("%+v %v\n", *malloc.GetStats(), uint64(0));
|
2008-12-18 16:42:28 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|