mirror of
https://github.com/servo/servo.git
synced 2025-07-31 03:00:29 +01:00
Measure heap memory usage for more types. Fixes #6951
This commit is contained in:
parent
94c8dcd575
commit
45145108da
175 changed files with 669 additions and 94 deletions
|
@ -9,6 +9,7 @@ use dom::bindings::conversions::ToJSValConvertible;
|
|||
use dom::bindings::global::GlobalRef;
|
||||
use dom::domexception::{DOMException, DOMErrorName};
|
||||
|
||||
use util::mem::HeapSizeOf;
|
||||
use util::str::DOMString;
|
||||
|
||||
use js::jsapi::{JSContext, JSObject, RootedValue};
|
||||
|
@ -24,7 +25,7 @@ use std::ptr;
|
|||
use std::mem;
|
||||
|
||||
/// DOM exceptions that can be thrown by a native DOM method.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, HeapSizeOf)]
|
||||
pub enum Error {
|
||||
/// IndexSizeError DOMException
|
||||
IndexSize,
|
||||
|
|
|
@ -27,6 +27,8 @@ use js::jsapi::{GetGlobalForObjectCrossCompartment};
|
|||
use js::jsapi::{JSContext, JSObject, JS_GetClass, MutableHandleValue};
|
||||
use url::Url;
|
||||
|
||||
use util::mem::HeapSizeOf;
|
||||
|
||||
/// A freely-copyable reference to a rooted global object.
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum GlobalRef<'a> {
|
||||
|
@ -47,7 +49,7 @@ pub enum GlobalRoot {
|
|||
|
||||
/// A traced reference to a global object, for use in fields of traced Rust
|
||||
/// structures.
|
||||
#[derive(JSTraceable)]
|
||||
#[derive(JSTraceable, HeapSizeOf)]
|
||||
#[must_root]
|
||||
pub enum GlobalField {
|
||||
/// A field for a `Window` object.
|
||||
|
|
|
@ -463,4 +463,3 @@ impl<T: Reflectable> Drop for Root<T> {
|
|||
unsafe { (*self.root_list).unroot(self); }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,8 +11,10 @@ use std::ops;
|
|||
use std::str;
|
||||
use std::str::FromStr;
|
||||
|
||||
use util::mem::HeapSizeOf;
|
||||
|
||||
/// Encapsulates the IDL `ByteString` type.
|
||||
#[derive(JSTraceable,Clone,Eq,PartialEq)]
|
||||
#[derive(JSTraceable, Clone, Eq, PartialEq, HeapSizeOf)]
|
||||
pub struct ByteString(Vec<u8>);
|
||||
|
||||
impl ByteString {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue