aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/nodelist.rs
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-08-13 13:16:14 -0600
committerbors-servo <metajack+bors@gmail.com>2015-08-13 13:16:14 -0600
commita03616f379c255cc6c9b6e1d04dd7d98bd9926ce (patch)
tree0081f3c1bb513706b406a61fba0f73449cbc5ba4 /components/script/dom/nodelist.rs
parentf3b7c5cb4b0fab20db51b7560c3b3bb2d115be69 (diff)
parent45145108daa6af7e834a7c23530857c504b54b9c (diff)
downloadservo-a03616f379c255cc6c9b6e1d04dd7d98bd9926ce.tar.gz
servo-a03616f379c255cc6c9b6e1d04dd7d98bd9926ce.zip
Auto merge of #7097 - boghison:memtypes, r=jdm
Measure heap memory usage for more types. Fixes #6951 Also adds HeapSizeOf implementations/derive for some types. I've used "Cannot calculate Heap size" as a reason everywhere, because my imagination is rather limited. If you'd like me to change this message for specific types, please write something like this: "Trusted - Cannot calculate Heap size for Trusted" so that it would be easier for me to replace them through a script :) <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7097) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/nodelist.rs')
-rw-r--r--components/script/dom/nodelist.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/components/script/dom/nodelist.rs b/components/script/dom/nodelist.rs
index 0c6583a684d..bcf941a6aa0 100644
--- a/components/script/dom/nodelist.rs
+++ b/components/script/dom/nodelist.rs
@@ -13,7 +13,7 @@ use dom::window::Window;
use std::cell::Cell;
-#[derive(JSTraceable)]
+#[derive(JSTraceable, HeapSizeOf)]
#[must_root]
pub enum NodeListType {
Simple(Vec<JS<Node>>),
@@ -22,6 +22,7 @@ pub enum NodeListType {
// https://dom.spec.whatwg.org/#interface-nodelist
#[dom_struct]
+#[derive(HeapSizeOf)]
pub struct NodeList {
reflector_: Reflector,
list_type: NodeListType,
@@ -93,10 +94,11 @@ impl<'a> NodeListHelpers<'a> for &'a NodeList {
}
}
-#[derive(JSTraceable)]
+#[derive(JSTraceable, HeapSizeOf)]
#[must_root]
pub struct ChildrenList {
node: JS<Node>,
+ #[ignore_heap_size_of = "Defined in rust-mozjs"]
last_visited: MutNullableHeap<JS<Node>>,
last_index: Cell<u32>,
}