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

Bump heapsize to 0.3

  • Loading branch information
nox committed Feb 13, 2016
commit 55dcee94be61b05ce85c4226a285e3f63b95fc1c
@@ -37,7 +37,7 @@ path = "../util"
[dependencies]
cssparser = {version = "0.5.3", features = ["heap_size", "serde-serialization"]}
euclid = {version = "0.6.2", features = ["plugins"]}
heapsize = "0.2.5"
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
serde_macros = "0.6"

@@ -20,7 +20,7 @@ git = "https://github.com/servo/ipc-channel"
path = "../plugins"

[dependencies]
heapsize = "0.2.5"
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
hyper = { version = "0.7", features = [ "serde-serialization" ] }
time = "0.1"
@@ -14,7 +14,7 @@ bitflags = "0.3"
euclid = {version = "0.6.2", features = ["plugins"]}
fnv = "1.0"
harfbuzz-sys = "0.1"
heapsize = "0.2.5"
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
lazy_static = "0.1"
libc = "0.2"
@@ -1257,7 +1257,7 @@ pub struct GradientDisplayItem {
impl HeapSizeOf for GradientDisplayItem {
fn heap_size_of_children(&self) -> usize {
use heapsize::heap_size_of;
use libc::c_void;
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
@@ -28,7 +28,7 @@ const FT_ALIGNMENT: usize = 1;
extern fn ft_alloc(mem: FT_Memory, req_size: c_long) -> *mut c_void {
unsafe {
let ptr = heap::allocate(req_size as usize, FT_ALIGNMENT) as *mut c_void;
let actual_size = heap_size_of(ptr);
let actual_size = heap_size_of(ptr as *const _);

let user = (*mem).user as *mut User;
(*user).size += actual_size;
@@ -39,7 +39,7 @@ extern fn ft_alloc(mem: FT_Memory, req_size: c_long) -> *mut c_void {

extern fn ft_free(mem: FT_Memory, ptr: *mut c_void) {
unsafe {
let actual_size = heap_size_of(ptr);
let actual_size = heap_size_of(ptr as *const _);

let user = (*mem).user as *mut User;
(*user).size -= actual_size;
@@ -51,10 +51,10 @@ extern fn ft_free(mem: FT_Memory, ptr: *mut c_void) {
extern fn ft_realloc(mem: FT_Memory, _cur_size: c_long, new_req_size: c_long,
old_ptr: *mut c_void) -> *mut c_void {
unsafe {
let old_actual_size = heap_size_of(old_ptr);
let old_actual_size = heap_size_of(old_ptr as *const _);
let new_ptr = heap::reallocate(old_ptr as *mut u8, old_actual_size,
new_req_size as usize, FT_ALIGNMENT) as *mut c_void;
let new_actual_size = heap_size_of(new_ptr);
let new_actual_size = heap_size_of(new_ptr as *const _);

let user = (*mem).user as *mut User;
(*user).size += new_actual_size;
@@ -90,11 +90,12 @@ impl Drop for FreeTypeLibraryHandle {

impl HeapSizeOf for FreeTypeLibraryHandle {
fn heap_size_of_children(&self) -> usize {
let ft_size = unsafe { (*self.user).size };
ft_size +
heap_size_of(self.ctx as *const c_void) +
heap_size_of(self.mem as *const c_void) +
heap_size_of(self.user as *const c_void)
unsafe {
(*self.user).size +
heap_size_of(self.ctx as *const _) +
heap_size_of(self.mem as *const _) +
heap_size_of(self.user as *const _)
}
}
}

@@ -26,7 +26,7 @@ path = "../util"

[dependencies]
euclid = {version = "0.6.2", features = ["plugins"]}
heapsize = "0.2.5"
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
serde = "0.6"
serde_macros = "0.6"
@@ -59,7 +59,7 @@ bitflags = "0.3"
cssparser = {version = "0.5.3", features = ["heap_size", "serde-serialization"]}
euclid = {version = "0.6.2", features = ["plugins"]}
fnv = "1.0"
heapsize = "0.2.5"
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
libc = "0.2"
log = "0.3"
@@ -24,7 +24,7 @@ path = "../plugins"
bitflags = "0.3"
cssparser = {version = "0.5.3", features = ["heap_size", "serde-serialization"]}
euclid = {version = "0.6.2", features = ["plugins"]}
heapsize = "0.2.5"
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
hyper = { version = "0.7", features = [ "serde-serialization" ] }
rustc-serialize = "0.3.4"
@@ -20,7 +20,7 @@ git = "https://github.com/servo/ipc-channel"
path = "../plugins"

[dependencies]
heapsize = "0.2.5"
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
hyper = { version = "0.7", features = [ "serde-serialization" ] }
image = "0.5.0"
@@ -70,7 +70,7 @@ cssparser = {version = "0.5.3", features = ["heap_size", "serde-serialization"]}
encoding = "0.2"
euclid = {version = "0.6.2", features = ["plugins"]}
fnv = "1.0"
heapsize = "0.2.5"
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
html5ever = {version = "0.5.1", features = ["heap_size", "unstable"]}
hyper = { version = "0.7", features = [ "serde-serialization" ] }
@@ -36,6 +36,7 @@ use js::{JS_CALLEE};
use libc::{self, c_uint};
use std::default::Default;
use std::ffi::CString;
use std::os::raw::c_void;
use std::ptr;
use util::non_geckolib::jsstring_to_str;

@@ -91,7 +92,7 @@ pub struct DOMClass {
pub type_id: TopTypeId,

/// The HeapSizeOf function wrapper for that interface.
pub heap_size_of: unsafe fn(*const libc::c_void) -> usize,
pub heap_size_of: unsafe fn(*const c_void) -> usize,
}
unsafe impl Sync for DOMClass {}

@@ -2446,7 +2446,7 @@ impl HeapSizeOf for UniqueId {
#[allow(unsafe_code)]
fn heap_size_of_children(&self) -> usize {
if let &Some(ref uuid) = unsafe { &*self.cell.get() } {
heap_size_of(&** uuid as *const Uuid as *const c_void)
unsafe { heap_size_of(&** uuid as *const Uuid as *const _) }
} else {
0
}
@@ -7,7 +7,7 @@
use dom::bindings::conversions::get_dom_class;
use dom::bindings::reflector::Reflectable;
use heapsize::{HeapSizeOf, heap_size_of};
use libc::c_void;
use std::os::raw::c_void;

// This is equivalent to measuring a Box<T>, except that DOM objects lose their
// associated box in order to stash their pointers in a reserved slot of their
@@ -43,7 +43,7 @@ git = "https://github.com/servo/ipc-channel"
[dependencies]
app_units = {version = "0.2.1", features = ["plugins"]}
euclid = {version = "0.6.2", features = ["plugins"]}
heapsize = "0.2.5"
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
libc = "0.2"
serde = "0.6"

Some generated files are not rendered by default. Learn more.

@@ -25,7 +25,7 @@ cssparser = {version = "0.5.3", features = ["heap_size", "serde-serialization"]}
encoding = "0.2"
euclid = {version = "0.6.2", features = ["plugins"]}
fnv = "1.0"
heapsize = "0.2.5"
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
lazy_static = "0.1.10"
log = "0.3"
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.