aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/gecko_string_cache
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2017-09-12 12:03:01 +1000
committerNicholas Nethercote <nnethercote@mozilla.com>2017-09-12 12:37:51 +1000
commit32548e5312e71d79af09f3bd6d25663d871d4dc6 (patch)
tree064a06d00d258974cccfecc06622c3c7c2c98c61 /components/style/gecko_string_cache
parent24b2d8d9cf265a149535ebc22941e427dd5e21b3 (diff)
downloadservo-32548e5312e71d79af09f3bd6d25663d871d4dc6.tar.gz
servo-32548e5312e71d79af09f3bd6d25663d871d4dc6.zip
Overhaul MallocSizeOf and related things.
This patch makes the MallocSizeOf stuff in Stylo work more like the HeapSizeOf stuff already in Servo, except better. In particular, it adds deriving support for MallocSizeOf, which will make it easier to improve coverage. The patch does the following. - Combines servo/components/style/stylesheets/memory.rs and the heapsize crate into a new crate, malloc_size_of. - Forks the heapsize_derive crate, calling it malloc_size_of, so that MallocSizeOf can be derived. - Both the new crates have MIT/Apache licenses, like heapsize, in case they are incorporated into heapsize in the future. - Renames the methods within MallocSizeOf and the related traits so they are more concise. - Removes MallocSizeOfWithGuard. - Adds `derive(MallocSizeOf)` to a lot of types, in some cases replacing an equivalent or almost-equivalent hand-written implementation. - Adds stuff so that Rc/Arc can be handled properly.
Diffstat (limited to 'components/style/gecko_string_cache')
-rw-r--r--components/style/gecko_string_cache/mod.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/components/style/gecko_string_cache/mod.rs b/components/style/gecko_string_cache/mod.rs
index 3844ddc2997..0c75e0c43ca 100644
--- a/components/style/gecko_string_cache/mod.rs
+++ b/components/style/gecko_string_cache/mod.rs
@@ -388,3 +388,5 @@ impl From<*mut nsIAtom> for Atom {
}
}
}
+
+size_of_is_0!(Atom);