mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
Use heapsize_derive instead of heapsize_plugin
This commit is contained in:
parent
b640a83725
commit
5bb4c6c884
34 changed files with 152 additions and 90 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue