Define conditional_malloc_size_of for all Rc (#39660)

This updates all Rc that were ignored for malloc_size_of to use
conditional_malloc_size_of, unless the type in the Rc itself doesn't
support malloc_size.

Regular expressions used to search for all occurrences:

```
ignore_malloc_size_of = "Rc.*"
ignore_malloc_size_of = "Arc.*"
```

There are a couple left since they have nested Rc, which I don't know
how to fix.

To be able to define these, several new implementations were added to
`malloc_size_of/lib.rs` as well as
`HashMapTracedValues`.

Testing: if it compiles, it's safe

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
Tim van der Lippe
2025-10-05 17:12:16 +02:00
committed by GitHub
parent 19a8f826a5
commit 6a0f9d1bcb
73 changed files with 226 additions and 147 deletions

View File

@@ -29,7 +29,7 @@ use crate::script_runtime::CanGc;
#[dom_struct]
pub(crate) struct HTMLObjectElement {
htmlelement: HTMLElement,
#[ignore_malloc_size_of = "Arc"]
#[ignore_malloc_size_of = "RasterImage"]
#[no_trace]
image: DomRefCell<Option<Arc<RasterImage>>>,
form_owner: MutNullableDom<HTMLFormElement>,