summaryrefslogtreecommitdiff
path: root/test/mallocrep.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-01-16 16:12:14 -0800
committerRuss Cox <rsc@golang.org>2009-01-16 16:12:14 -0800
commit69ebaa23298a6ea400acd1b300221f93a1cefc52 (patch)
tree7da3dc3316609873715c3e6e7871cb2bf57da081 /test/mallocrep.go
parentc10979708228db68df69d1167f330127dac34a3f (diff)
downloadgolang-69ebaa23298a6ea400acd1b300221f93a1cefc52.tar.gz
convert tests; nothing interesting.
R=r OCL=23012 CL=23014
Diffstat (limited to 'test/mallocrep.go')
-rw-r--r--test/mallocrep.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/mallocrep.go b/test/mallocrep.go
index 26537a0bf..6aa8fdf8c 100644
--- a/test/mallocrep.go
+++ b/test/mallocrep.go
@@ -17,12 +17,12 @@ var chatty = flag.Bool("v", false, "chatty");
var oldsys uint64;
func bigger() {
- if st := malloc.GetStats(); oldsys < st.sys {
- oldsys = st.sys;
+ if st := malloc.GetStats(); oldsys < st.Sys {
+ oldsys = st.Sys;
if *chatty {
- println(st.sys, " system bytes for ", st.alloc, " Go bytes");
+ println(st.Sys, " system bytes for ", st.Alloc, " Go bytes");
}
- if st.sys > 1e9 {
+ if st.Sys > 1e9 {
panicln("too big");
}
}
@@ -30,16 +30,16 @@ func bigger() {
func main() {
flag.Parse();
- malloc.GetStats().alloc = 0; // ignore stacks
+ malloc.GetStats().Alloc = 0; // ignore stacks
for i := 0; i < 1<<8; i++ {
for j := 1; j <= 1<<22; j<<=1 {
if i == 0 && *chatty {
println("First alloc:", j);
}
b := malloc.Alloc(uint64(j));
- during := malloc.GetStats().alloc;
+ during := malloc.GetStats().Alloc;
malloc.Free(b);
- if a := malloc.GetStats().alloc; a != 0 {
+ if a := malloc.GetStats().Alloc; a != 0 {
panicln("malloc wrong count", a, "after", j, "during", during);
}
bigger();