mirror of
https://github.com/golang/go
synced 2024-11-22 01:14:40 -07:00
226fb099d9
Drops mallocrep1.go back to a reasonable amount of time. (154 -> 0.8 seconds on my Mac) Fixes #2085. R=golang-dev, dvyukov, r CC=golang-dev https://golang.org/cl/4811045
26 lines
467 B
Go
26 lines
467 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"
|
|
"runtime"
|
|
)
|
|
|
|
var chatty = flag.Bool("v", false, "chatty")
|
|
|
|
func main() {
|
|
runtime.Free(runtime.Alloc(1))
|
|
runtime.UpdateMemStats()
|
|
if *chatty {
|
|
fmt.Printf("%+v %v\n", runtime.MemStats, uint64(0))
|
|
}
|
|
}
|