summaryrefslogtreecommitdiff
path: root/src/pkg/reflect/all_test.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-06-16 11:08:30 +0200
committerOndřej Surý <ondrej@sury.org>2011-06-16 11:08:30 +0200
commit8652e6c371b8905498d3d314491d36c58d5f68d5 (patch)
tree3d5ad7192ed8d0dd063bb7531ff9095dc6780588 /src/pkg/reflect/all_test.go
parentda195b66d4d4df70e6884c8743382a244757cd20 (diff)
downloadgolang-8652e6c371b8905498d3d314491d36c58d5f68d5.tar.gz
Imported Upstream version 57.2upstream/57.2
Diffstat (limited to 'src/pkg/reflect/all_test.go')
-rw-r--r--src/pkg/reflect/all_test.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pkg/reflect/all_test.go b/src/pkg/reflect/all_test.go
index dee3f4915..e20e03f50 100644
--- a/src/pkg/reflect/all_test.go
+++ b/src/pkg/reflect/all_test.go
@@ -1459,7 +1459,9 @@ func noAlloc(t *testing.T, n int, f func(int)) {
for j := 0; j < n; j++ {
f(j)
}
- if runtime.MemStats.Mallocs != 0 {
+ // A few allocs may happen in the testing package when GOMAXPROCS > 1, so don't
+ // require zero mallocs.
+ if runtime.MemStats.Mallocs > 5 {
t.Fatalf("%d mallocs after %d iterations", runtime.MemStats.Mallocs, n)
}
}