From eeb917e462ae86c8ac6eedac5118c6a7ed6257cc Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sat, 8 Aug 2015 20:51:45 -0700 Subject: [PATCH] Add heapsize support. Part of servo/heapsize#5. --- Cargo.toml | 6 ++++++ src/azure.rs | 2 +- src/azure_hl.rs | 2 +- src/lib.rs | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 475c1be..4369ec7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,12 @@ euclid = "0.1" serde = "*" serde_macros = "*" +[dependencies.heapsize] +git = "https://github.com/servo/heapsize" + +[dependencies.heapsize_plugin] +git = "https://github.com/servo/heapsize" + [dependencies.skia] git = "https://github.com/servo/skia" diff --git a/src/azure.rs b/src/azure.rs index 366b72a..172e6af 100644 --- a/src/azure.rs +++ b/src/azure.rs @@ -249,7 +249,7 @@ pub static AZ_ATT_TRANSFER_DISABLE_B: u32 = 2; pub static AZ_ATT_TRANSFER_DISABLE_A: u32 = 3; #[repr(C)] -#[derive(Copy, Clone, Deserialize, Serialize)] +#[derive(Copy, Clone, Deserialize, Serialize, HeapSizeOf)] pub struct struct__AzColor { pub r: AzFloat, pub g: AzFloat, diff --git a/src/azure_hl.rs b/src/azure_hl.rs index f569bf3..7b0ffcf 100644 --- a/src/azure_hl.rs +++ b/src/azure_hl.rs @@ -922,7 +922,7 @@ impl GradientStops { } #[repr(C)] -#[derive(Clone, Deserialize, Serialize)] +#[derive(Clone, Deserialize, Serialize, HeapSizeOf)] pub struct GradientStop { pub offset: AzFloat, pub color: Color, diff --git a/src/lib.rs b/src/lib.rs index 4eb52ef..48fea9e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,11 +6,14 @@ #![crate_type = "rlib"] #![feature(custom_derive, plugin)] #![plugin(serde_macros)] +#![plugin(heapsize_plugin)] extern crate libc; extern crate serde; extern crate euclid; extern crate skia; +#[macro_use] +extern crate heapsize; #[cfg(target_os = "linux")] extern crate x11; #[cfg(target_os = "android")]