Use heapsize_derive instead of heapsize_plugin

This commit is contained in:
Simon Sapin 2016-11-02 18:46:15 +01:00 committed by Anthony Ramine
parent b640a83725
commit 5bb4c6c884
34 changed files with 152 additions and 90 deletions

View file

@ -99,7 +99,7 @@ impl HeapSizeOf for FreeTypeLibraryHandle {
}
}
#[derive(Clone, HeapSizeOf, Debug)]
#[derive(Clone, Debug)]
pub struct FontContextHandle {
// WARNING: FreeTypeLibraryHandle contains raw pointers, is clonable, and also implements
// `Drop`. This field needs to be Rc<> to make sure that the `drop` function is only called
@ -107,6 +107,12 @@ pub struct FontContextHandle {
pub ctx: Rc<FreeTypeLibraryHandle>,
}
impl HeapSizeOf for FontContextHandle {
fn heap_size_of_children(&self) -> usize {
self.ctx.heap_size_of_children()
}
}
impl FontContextHandle {
pub fn new() -> FontContextHandle {
let user = Box::into_raw(box User {