cockroachdb / swiss

Go port of Google's Swiss Table hash table
Apache License 2.0
317 stars 12 forks source link

swiss: silence checkptr errors #25

Closed petermattis closed 8 months ago

petermattis commented 8 months ago

Silence the race-build checkptr warnings that are triggering on unsafeSlice.At and unsafeConvertSlice when accessing and constructing the empty group. The warnings are semi-valid as the empty group slice is actually the wrong size, but we never access group.slots on this group so that is ok.

cockroach-teamcity commented 8 months ago

This change is Reviewable

petermattis commented 8 months ago

I'm not entirely sure this is the right thing to do or if there is another way to avoid these checks in race builds.

petermattis commented 8 months ago

TFTR!

I poked around a little more. I could get rid of the go:nocheckptr declaration on unsafeConvertSlice by not using it to convert emptyCtrls to the "emptyGroup" slice. Doesn't really seem worth it, though. I don't see anything that can be done about the unsafeSlice.At call on an "emptyGroup". I've added some additional commentary to explain what is going on and why these declarations are necessary.