You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Review and improve HashMap's handling of an empty table #53853
In #53804, I fixed the most immediate problem arising from how HashMap handles the empty table, but @gnzlbg still (rightly) sees more problems. We still use 1 instead of NonNull::dangling() as value for EMPTY, and ptr() even tests equality with EMPTY to return NULL instead. We can't really use non-NULL pointers as sentinel values like that, and NULL is often a worse choice than an aligned dangling pointer because the latter are at least valid for zero-sized operations.
I'm going to close this issue since our hash maps are now a thin wrapper around hashbrown which hopefully doesn't suffer from these issues; if it does, this should be refiled upstream. A cursory examination didn't find any obvious problems for sentinel use of dangling or so.
Yes none of this applies to the new hashbrown impl. cc @Amanieu in case they want to re-read the comments and any of that rings a bell, but I haven't see anything like that in hashbrown.
Activity
Mark-Simulacrum commentedon Dec 23, 2019
I'm going to close this issue since our hash maps are now a thin wrapper around hashbrown which hopefully doesn't suffer from these issues; if it does, this should be refiled upstream. A cursory examination didn't find any obvious problems for sentinel use of dangling or so.
gnzlbg commentedon Dec 24, 2019
Yes none of this applies to the new hashbrown impl. cc @Amanieu in case they want to re-read the comments and any of that rings a bell, but I haven't see anything like that in hashbrown.
Amanieu commentedon Dec 24, 2019
I agree, I don't think any of this applies to hashbrown.