aboutsummaryrefslogtreecommitdiffstats
path: root/components/util/mem.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-05-27 22:11:01 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-06-03 07:14:18 +0530
commita5975e8f33b5404493893ffd6ece776de9763d26 (patch)
tree10f442a40298fa5d6e5f85ca5db2a96e9304e75d /components/util/mem.rs
parentc1daf889afd396226bf4eb6a90a0a084e4677dc5 (diff)
downloadservo-a5975e8f33b5404493893ffd6ece776de9763d26.tar.gz
servo-a5975e8f33b5404493893ffd6ece776de9763d26.zip
use knownheapsize for geom stuff
Diffstat (limited to 'components/util/mem.rs')
-rw-r--r--components/util/mem.rs18
1 files changed, 15 insertions, 3 deletions
diff --git a/components/util/mem.rs b/components/util/mem.rs
index 8bbfb909199..6c9f04af984 100644
--- a/components/util/mem.rs
+++ b/components/util/mem.rs
@@ -9,6 +9,11 @@ use std::collections::LinkedList;
use std::mem::transmute;
use std::sync::Arc;
+use geom::{Point2D, Rect, SideOffsets2D, Size2D, Matrix2D};
+
+use geometry::Au;
+use range::Range;
+
extern {
// Get the size of a heap block.
//
@@ -172,17 +177,24 @@ macro_rules! known_heap_size(
}
)+
);
- ($size: expr, $ty:ident<$($gen:ident),+>) => (
- impl<$($gen),+> $crate::mem::HeapSizeOf for $ty<$($gen),+> {
+ ($size: expr, $($ty:ident<$($gen:ident),+>),+) => (
+ $(
+ impl<$($gen: $crate::mem::HeapSizeOf),+> $crate::mem::HeapSizeOf for $ty<$($gen),+> {
#[inline(always)]
fn heap_size_of_children(&self) -> usize {
$size
}
}
+ )+
);
);
known_heap_size!(0, u8, u16, u32, u64, usize);
known_heap_size!(0, i8, i16, i32, i64, isize);
-known_heap_size!(0, bool);
+known_heap_size!(0, bool, f32, f64);
+
+known_heap_size!(0, Rect<T>, Point2D<T>, Size2D<T>, Matrix2D<T>, SideOffsets2D<T>);
+
+known_heap_size!(0, Au);
+known_heap_size!(0, Range<T>); \ No newline at end of file