-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Basic refactoring of HashMap #32058
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic refactoring of HashMap #32058
Conversation
travis is failing |
Sadly, I am currently contractually barred from reviewing this code. r? @cgaebel |
Ah shoot. r? @apasel422 |
uhhhh r? @bluss ??? |
bors where r u |
no homu, no highfive, aaaah |
I'll take a look when travis passess. |
c9c4e93
to
d67cf45
Compare
Sorry, forgot to push changes |
|
fixed |
} | ||
} | ||
|
||
impl<K, V, M> DerefMut for FullBucket<K, V, M> where M: DerefMut<Target=RawTable<K, V>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that this impl is safe - giving arbitrary access to the underlying RawTable
means that a user could resize or replace the RawTable
out from under the FullBucket
, making it invalid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative would be to put an equivalent but unsafe method on Put
to fetch the table. By making the method unsafe, any violation of memory safety would still have to use unsafe code.
Added fixes for @gereeter's review. |
The type signatures are getting a little crazy for a simple hashtable, but that's neither the singular doing of this patch, nor necessarily uncalled for. Looks good to me. |
⌛ Testing commit 64adca7 with merge 1abcf47... |
💔 Test failed - auto-win-msvc-64-opt-rustbuild |
@bors: retry On Tuesday, March 22, 2016, bors notifications@github.com wrote:
|
No description provided.