Skip to content

Commit

Permalink
Add HeapSizeOf support.
Browse files Browse the repository at this point in the history
Part of Part of servo/heapsize#5.
  • Loading branch information
notriddle committed Oct 19, 2015
1 parent bdb254b commit afb4e62
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ doctest = false

[features]
unstable = ["html5ever_macros", "tendril/unstable", "string_cache/unstable", "string_cache_plugin", "rc/unstable"]
heap_size = ["heapsize", "heapsize_plugin"]

[dependencies]
time = "0"
Expand All @@ -27,6 +28,8 @@ string_cache_plugin = { version = "0.1.5", optional = true }
mac = "0"
tendril = "0.1.3"
rc = "0.1.1"
heapsize = { version = "0.1.1", optional = true }
heapsize_plugin = { version = "0.1.0", optional = true }

[dev-dependencies]
rustc-serialize = "0.3.15"
Expand Down
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

#![cfg_attr(feature = "unstable", plugin(string_cache_plugin))]

#![cfg_attr(feature = "heap_size", feature(plugin, custom_derive))]
#![cfg_attr(feature = "heap_size", plugin(heapsize_plugin))]
#[cfg(feature = "heap_size")]
extern crate heapsize;

extern crate rc;

#[macro_use]
Expand Down
1 change: 1 addition & 0 deletions src/tree_builder/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub use self::NodeOrText::{AppendNode, AppendText};

/// A document's quirks mode.
#[derive(PartialEq, Eq, Copy, Clone, Hash, Debug)]
#[cfg_attr(feature = "heap_size", derive(HeapSizeOf))]
pub enum QuirksMode {
Quirks,
LimitedQuirks,
Expand Down

0 comments on commit afb4e62

Please sign in to comment.