-
Notifications
You must be signed in to change notification settings - Fork 343
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
Canonical AllocID #1190
Canonical AllocID #1190
Conversation
This comment has been minimized.
This comment has been minimized.
Miri: let machine canonicalize AllocIDs This implements the rustc side of the plan I laid out [here](rust-lang/miri#1147 (comment)). Miri PR: rust-lang/miri#1190
Miri: let machine canonicalize AllocIDs This implements the rustc side of the plan I laid out [here](rust-lang/miri#1147 (comment)). Miri PR: rust-lang/miri#1190
f0a4a62
to
21a5da9
Compare
@bors r+ |
📌 Commit 59bddba has been approved by |
☀️ Test successful - checks-travis, status-appveyor |
@@ -74,7 +74,11 @@ pub struct MemoryExtra { | |||
pub stacked_borrows: Option<stacked_borrows::MemoryExtra>, | |||
pub intptrcast: intptrcast::MemoryExtra, | |||
|
|||
/// Mapping extern static names to their canonical allocation. | |||
pub(crate) extern_statics: HashMap<&'static str, AllocId>, |
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 wonder if this should be keyed on Symbol
instead.
Also, does miri not use FxHashMap
s? They're an easy speed boost for rustc but idk how relevant that is here.
(Sorry if this stuff has been discussed before in the context of miri, I haven't personally seen anything about this)
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.
Miri doesn't currently use FxHashMap
but probably should, yeah.
As for Symbol
, I honestly doubt it's worth all the trouble that brings with it.
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.
worth all the trouble that brings with it
You always start with Symbol
for looking up things and then call .as_str()
on it, the only thing that's more complex is inserting (you have to call Symbol::intern("...")
) but that happens only once.
This is the Miri side of rust-lang/rust#69408.
This just ports the existing extern statics to the new system; no new shims are added.
Cc @christianpoveda