diff options
author | Manish Goregaokar <manishsmail@gmail.com> | 2015-05-27 22:11:01 +0530 |
---|---|---|
committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-06-03 07:14:18 +0530 |
commit | a5975e8f33b5404493893ffd6ece776de9763d26 (patch) | |
tree | 10f442a40298fa5d6e5f85ca5db2a96e9304e75d /components/util/mem.rs | |
parent | c1daf889afd396226bf4eb6a90a0a084e4677dc5 (diff) | |
download | servo-a5975e8f33b5404493893ffd6ece776de9763d26.tar.gz servo-a5975e8f33b5404493893ffd6ece776de9763d26.zip |
use knownheapsize for geom stuff
Diffstat (limited to 'components/util/mem.rs')
-rw-r--r-- | components/util/mem.rs | 18 |
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 |