aboutsummaryrefslogtreecommitdiff
path: root/test/mallocrep.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2008-12-19 03:13:39 -0800
committerRuss Cox <rsc@golang.org>2008-12-19 03:13:39 -0800
commitda0a7d7b8f896bc2117ce488c4e245d626ef8aba (patch)
tree9b40150f73466d543e7724ee596fb3c4ef094e72 /test/mallocrep.go
parentba882f9940361e7f9f969fcc1cc613e735d38191 (diff)
downloadgo-da0a7d7b8f896bc2117ce488c4e245d626ef8aba.tar.xz
malloc bug fixes.
use malloc by default. free stacks. R=r DELTA=424 (333 added, 29 deleted, 62 changed) OCL=21553 CL=21584
Diffstat (limited to 'test/mallocrep.go')
-rw-r--r--test/mallocrep.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/mallocrep.go b/test/mallocrep.go
index 2911b4a051..8373cc0eb9 100644
--- a/test/mallocrep.go
+++ b/test/mallocrep.go
@@ -31,15 +31,17 @@ func bigger() {
func main() {
flag.Parse();
+ 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;
malloc.Free(b);
if a := malloc.GetStats().alloc; a != 0 {
- panicln("malloc wrong count", a);
+ panicln("malloc wrong count", a, "after", j, "during", during);
}
bigger();
}