Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump heapsize to 0.3 #9622

Merged
merged 12 commits into from Feb 13, 2016
Prev

Derive HeapSizeOf for GradientDisplayItem

  • Loading branch information
nox committed Feb 13, 2016
commit 966da85791f0efb31753becaf72ff16062100025
@@ -1238,7 +1238,7 @@ pub struct ImageDisplayItem {


/// Paints a gradient.
#[derive(Clone, Deserialize, Serialize)]
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct GradientDisplayItem {
/// Fields common to all display items.
pub base: BaseDisplayItem,
@@ -1253,21 +1253,6 @@ pub struct GradientDisplayItem {
pub stops: Vec<GradientStop>,
}


impl HeapSizeOf for GradientDisplayItem {
fn heap_size_of_children(&self) -> usize {
use heapsize::heap_size_of;
use std::os::raw::c_void;

// We can't measure `stops` via Vec's HeapSizeOf implementation because GradientStop isn't
// defined in this module, and we don't want to import GradientStop into util::mem where
// the HeapSizeOf trait is defined. So we measure the elements directly.
self.base.heap_size_of_children() +
heap_size_of(self.stops.as_ptr() as *const c_void)
}
}


/// Paints a border.
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
pub struct BorderDisplayItem {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.