summaryrefslogtreecommitdiff
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
commit902c03dbf5832d103d487160db5b1a414b8cad3d (patch)
tree9b40150f73466d543e7724ee596fb3c4ef094e72 /test/mallocrep.go
parent9aa0ed4a0fe2a53fffc6011a64dfbb4346d18fe8 (diff)
downloadgolang-902c03dbf5832d103d487160db5b1a414b8cad3d.tar.gz
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 2911b4a05..8373cc0eb 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();
}