-
Notifications
You must be signed in to change notification settings - Fork 373
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
[refactor] Move Caches
to re_viewer_ctx
and make it generic
#2043
Conversation
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.
nice nice nice, but let's get the verbosity down and also add some memory tracking while we're at it!
fn purge_memory(&mut self); | ||
|
||
/// Converts itself to a mutable reference of [`Any`], which enables mutable downcasting to concrete types. | ||
fn as_any_mut(&mut self) -> &mut dyn Any; |
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 would be great with an fn bytes_used(&self) -> usize
here too. Then we could easily iterate over all caches and show them in the memory panel!
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.
liking that idea a lot. I'll add a todo, want to move on with the actual refactoring quickly :)
…ntry` for brevity & consistency!
Another step towards moving
ViewerContext
tore_viewer_ctx
. Makes itscaches
field a container of generic caches and introduces aCache
trait that we can use throughout the viewer for.. caching things!It is expected that the store will take over more and more of that functionality, but meanwhile this is a nice home for what we have and will make it easier to move it again.
Part of:
re_viewer
#1873Checklist
PR Build Summary: https://build.rerun.io/pr/2043