4 ms·
`#[ignore_heap_size_of = "Because it is a non-owning reference."] pub image: Arc<Image>,` Wouldn't it be possible to make the annotation smart enough to distin
by kstenerud 11y ago
`#[ignore_heap_size_of = "Because it is a non-owning reference."]
pub image: Arc<Image>,`
Wouldn't it be possible to make the annotation smart enough to distinguish between an owning and a non-owning reference?
- eddyb 11y agoIt would be easier to have an implementation for `Arc<T>` which either returns 0, or divides by the refcount.
- Manishearth 11y agoIt's easy to do that, we can just put known_heap_size invocations for these. The reason this is ignored is that we want to figure out how we want to handle things like this (and haven't yet). We can ignore them, count them as <size>/<refcount>, or count their entire size for each owner. Depends on which one is more important for tracing memory bloat.