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