-
Notifications
You must be signed in to change notification settings - Fork 811
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
feat: Implement MemoryUsage
for Store
#2199
Conversation
MemoryUsage
for Store
MemoryUsage
for Store
4c4e8c6
to
2afed4d
Compare
MemoryUsage
for Store
MemoryUsage
for Store
bors try |
tryBuild failed: |
bors try |
tryBuild failed: |
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.
Looks good to me other than the fact that we shouldn't merge this upstream until we publish loupe
to crates.io 👍
impl<T: Tunables> MemoryUsage for LimitingTunables<T> { | ||
fn size_of_val(&self, _tracker: &mut dyn MemoryUsageTracker) -> usize { | ||
mem::size_of_val(self) | ||
} | ||
} | ||
|
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.
It's a bit surprising to me that this isn't something the macro can generate. I'm not sure how common of a base case it is, maybe it isn't worth 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.
It's because of the generic here. I need to dig into loupe-derive
to see what's going on.
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.
Fixed by wasmerio/loupe#14. I'll update this file in #2200 probably.
#[derive(Clone, Debug, PartialEq, Eq, Hash, MemoryUsage)] | ||
pub struct Target { | ||
#[loupe(skip)] | ||
triple: Triple, | ||
#[loupe(skip)] | ||
cpu_features: EnumSet<CpuFeature>, | ||
} |
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.
This might be the same as the thing I mentioned above, not high priority and easy to add later, but might be able to do something like
#[loupe(skip_all)]
pub struct Target {
...
}
To just get the local size and not any of the heap size stuff
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've created wasmerio/loupe#12.
bors try |
tryBuild failed: |
bors r+ |
2200: feat: Implement `MemoryUsage` for `Module` r=Hywan a=Hywan # Description This patch implements `loupe::MemoryUsage` for `wasmer::Module`. ~This PR includes #2199. To review unique patches: https://github.com/Hywan/wasmer/compare/feat-memory-usage...feat-memory-usage-module?expand=1~ # Review - [x] Add a short description of the the change to the CHANGELOG.md file Co-authored-by: Ivan Enderlin <[email protected]>
2200: feat: Implement `MemoryUsage` for `Module` r=Hywan a=Hywan # Description This patch implements `loupe::MemoryUsage` for `wasmer::Module`. ~This PR includes #2199. To review unique patches: https://github.com/Hywan/wasmer/compare/feat-memory-usage...feat-memory-usage-module?expand=1~ # Review - [x] Add a short description of the the change to the CHANGELOG.md file Co-authored-by: Ivan Enderlin <[email protected]>
2200: feat: Implement `MemoryUsage` for `Module` r=Hywan a=Hywan # Description This patch implements `loupe::MemoryUsage` for `wasmer::Module`. ~This PR includes #2199. To review unique patches: https://github.com/Hywan/wasmer/compare/feat-memory-usage...feat-memory-usage-module?expand=1~ # Review - [x] Add a short description of the the change to the CHANGELOG.md file Co-authored-by: Ivan Enderlin <[email protected]>
Description
This patch implements
loupe::MemoryUsage
forwasmer::Store
.Review