aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2016-04-10 10:43:04 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2016-04-10 20:01:47 +0000
commit974c201f74f730737964e5239da473fc548b408e (patch)
tree69b9d31448658921477bc4e6cba414c470a563ab /src
parenta44c4256ae958b0aacecd5fd0b0e7f1156f8bcf4 (diff)
downloadgo-974c201f74f730737964e5239da473fc548b408e.tar.xz
runtime: avoid unnecessary map iteration write barrier
Update #14921 Change-Id: I5c5816d0193757bf7465b1e09c27ca06897df4bf Reviewed-on: https://go-review.googlesource.com/21814 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/runtime/hashmap.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/runtime/hashmap.go b/src/runtime/hashmap.go
index 9e18192cd8..d549ce4194 100644
--- a/src/runtime/hashmap.go
+++ b/src/runtime/hashmap.go
@@ -790,7 +790,9 @@ next:
}
}
it.bucket = bucket
- it.bptr = b
+ if it.bptr != b { // avoid unnecessary write barrier; see issue 14921
+ it.bptr = b
+ }
it.i = i + 1
it.checkBucket = checkBucket
return