Skip to content

Commit ca0fdf6

Browse files
committed
Add HeapSizeOf support.
1 parent f0f3e53 commit ca0fdf6

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ optional = true
2222
[dependencies.serde_macros]
2323
optional = true
2424

25+
[dependencies.heapsize]
26+
git = "https://github.com/servo/heapsize.git"
27+
optional = true
28+
2529
[dependencies]
2630
encoding = "0.2"
2731
matches = "0.1"
2832

2933
[features]
3034
serde-serialization = [ "serde", "serde_macros" ]
31-
35+
heap_size = [ "heapsize" ]

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ extern crate encoding;
7171
#[cfg(test)] extern crate tempdir;
7272
#[cfg(test)] extern crate rustc_serialize;
7373
#[cfg(feature = "serde-serialization")] extern crate serde;
74+
#[cfg(feature = "heap_size")] #[macro_use] extern crate heapsize;
7475

7576
pub use tokenizer::{Token, NumericValue, PercentageValue, SourceLocation};
7677
pub use rules_and_declarations::{parse_important};
@@ -83,6 +84,8 @@ pub use nth::parse_nth;
8384
pub use serializer::{ToCss, CssStringWriter, serialize_identifier, serialize_string};
8485
pub use parser::{Parser, Delimiter, Delimiters, SourcePosition};
8586

87+
#[cfg(feature = "heap_size")] known_heap_size!(0, Color, RGBA);
88+
8689

8790
/**
8891

0 commit comments

Comments
 (0)