Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1337)

Issue 14367043: code review 14367043: runtime: fix bug in maps at the intersection of iterato... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 7 months ago by khr
Modified:
11 years, 7 months ago
Reviewers:
r, iant
CC:
golang-dev, r, khr1, iant
Visibility:
Public.

Description

runtime: fix bug in maps at the intersection of iterators, growing, and NaN keys If an iterator is started while a map is in the middle of a grow, and the map has NaN keys, then those keys might get returned by the iterator more than once. This fix makes the evacuation decision deterministic and repeatable for NaN keys so each one gets returned only once.

Patch Set 1 #

Patch Set 2 : diff -r 46f2731a6d53 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 3 : diff -r 46f2731a6d53 https://khr%40golang.org@code.google.com/p/go/ #

Total comments: 2

Patch Set 4 : diff -r 46f2731a6d53 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 5 : diff -r 46f2731a6d53 https://khr%40golang.org@code.google.com/p/go/ #

Total comments: 2

Patch Set 6 : diff -r 1129354ed002 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 7 : diff -r 1129354ed002 https://khr%40golang.org@code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+91 lines, -15 lines) Patch
M src/pkg/runtime/export_test.go View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M src/pkg/runtime/hashmap.c View 1 2 3 8 chunks +50 lines, -15 lines 0 comments Download
M src/pkg/runtime/map_test.go View 1 2 3 4 5 1 chunk +38 lines, -0 lines 0 comments Download

Messages

Total messages: 10
khr
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://khr%40golang.org@code.google.com/p/go/
11 years, 7 months ago (2013-10-03 23:37:11 UTC) #1
r
https://codereview.appspot.com/14367043/diff/6001/src/pkg/runtime/map_test.go File src/pkg/runtime/map_test.go (right): https://codereview.appspot.com/14367043/diff/6001/src/pkg/runtime/map_test.go#newcode389 src/pkg/runtime/map_test.go:389: // Trigger grow can you verify that it's full? ...
11 years, 7 months ago (2013-10-03 23:40:33 UTC) #2
khr1
Yes, 6.5 = 13/2. I don't think it is worth exposing that constant from inside ...
11 years, 7 months ago (2013-10-04 00:11:55 UTC) #3
r
It's trivial: just add a line to export_test.go -rob
11 years, 7 months ago (2013-10-04 00:25:13 UTC) #4
iant
https://codereview.appspot.com/14367043/diff/6001/src/pkg/runtime/hashmap.c File src/pkg/runtime/hashmap.c (right): https://codereview.appspot.com/14367043/diff/6001/src/pkg/runtime/hashmap.c#newcode886 src/pkg/runtime/hashmap.c:886: if(check_bucket >> (it->B - 1) != (b->tophash[i] & 1)) ...
11 years, 7 months ago (2013-10-04 16:20:21 UTC) #5
khr1
On Fri, Oct 4, 2013 at 9:20 AM, <iant@golang.org> wrote: > > https://codereview.appspot.**com/14367043/diff/6001/src/** > pkg/runtime/hashmap.c<https://codereview.appspot.com/14367043/diff/6001/src/pkg/runtime/hashmap.c> ...
11 years, 7 months ago (2013-10-04 20:04:06 UTC) #6
khr1
On Thu, Oct 3, 2013 at 5:24 PM, Rob Pike <r@golang.org> wrote: > It's trivial: ...
11 years, 7 months ago (2013-10-04 20:06:04 UTC) #7
iant
LGTM
11 years, 7 months ago (2013-10-04 20:19:45 UTC) #8
r
LGTM but please remove some capital letters https://codereview.appspot.com/14367043/diff/20001/src/pkg/runtime/map_test.go File src/pkg/runtime/map_test.go (right): https://codereview.appspot.com/14367043/diff/20001/src/pkg/runtime/map_test.go#newcode380 src/pkg/runtime/map_test.go:380: const NBUCKETS ...
11 years, 7 months ago (2013-10-04 20:30:42 UTC) #9
khr
11 years, 7 months ago (2013-10-04 20:54:06 UTC) #10
*** Submitted as https://code.google.com/p/go/source/detail?r=4b40cc3a2641 ***

runtime: fix bug in maps at the intersection of iterators, growing, and NaN keys

If an iterator is started while a map is in the middle of a grow,
and the map has NaN keys, then those keys might get returned by
the iterator more than once.  This fix makes the evacuation decision
deterministic and repeatable for NaN keys so each one gets returned
only once.

R=golang-dev, r, khr, iant
CC=golang-dev
https://codereview.appspot.com/14367043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b