Skip to content
Permalink
Browse files

Replace all uses of the `heapsize` crate with `malloc_size_of`.

Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`.
`malloc_size_of` is better -- it handles various cases that `heapsize` does not
-- so this patch changes Servo to use `malloc_size_of`.

This patch makes the following changes to the `malloc_size_of` crate.

- Adds `MallocSizeOf` trait implementations for numerous types, some built-in
  (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`).

- Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't
  support that operation.

- For `HashSet`/`HashMap`, falls back to a computed estimate when
  `enclosing_size_of_op` isn't available.

- Adds an extern "C" `malloc_size_of` function that does the actual heap
  measurement; this is based on the same functions from the `heapsize` crate.

This patch makes the following changes elsewhere.

- Converts all the uses of `heapsize` to instead use `malloc_size_of`.

- Disables the "heapsize"/"heap_size" feature for the external crates that
  provide it.

- Removes the `HeapSizeOf` implementation from `hashglobe`.

- Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of`
  doesn't derive those types, unlike `heapsize`.
  • Loading branch information
nnethercote committed Oct 18, 2017
1 parent 421baa8 commit 4506f0d30cbbb02df32e9c16135ef288ad6b7e2e
Showing with 1,419 additions and 1,522 deletions.
  1. +32 −50 Cargo.lock
  2. +1 −1 components/atoms/Cargo.toml
  3. +2 −2 components/canvas_traits/Cargo.toml
  4. +8 −8 components/canvas_traits/canvas.rs
  5. +2 −2 components/canvas_traits/lib.rs
  6. +7 −10 components/canvas_traits/webgl.rs
  7. +2 −2 components/devtools_traits/Cargo.toml
  8. +5 −5 components/devtools_traits/lib.rs
  9. +1 −1 components/dom_struct/lib.rs
  10. +2 −1 components/geometry/Cargo.toml
  11. +3 −4 components/geometry/lib.rs
  12. +2 −2 components/gfx/Cargo.toml
  13. +39 −39 components/gfx/display_list/mod.rs
  14. +4 −4 components/gfx/font_context.rs
  15. +3 −2 components/gfx/lib.rs
  16. +13 −13 components/gfx/platform/freetype/font_context.rs
  17. +1 −9 components/gfx/platform/macos/font_context.rs
  18. +1 −7 components/gfx/platform/windows/font_context.rs
  19. +2 −2 components/gfx_traits/Cargo.toml
  20. +5 −5 components/gfx_traits/lib.rs
  21. +0 −1 components/hashglobe/Cargo.toml
  22. +0 −16 components/hashglobe/src/fake.rs
  23. +0 −2 components/hashglobe/src/lib.rs
  24. +1 −1 components/layout/Cargo.toml
  25. +3 −3 components/layout/context.rs
  26. +1 −1 components/layout/lib.rs
  27. +1 −1 components/layout_thread/Cargo.toml
  28. +9 −6 components/layout_thread/lib.rs
  29. +11 −0 components/malloc_size_of/Cargo.toml
  30. +373 −32 components/malloc_size_of/lib.rs
  31. +2 −2 components/msg/Cargo.toml
  32. +8 −8 components/msg/constellation_msg.rs
  33. +2 −2 components/msg/lib.rs
  34. +1 −1 components/net/Cargo.toml
  35. +3 −3 components/net_traits/Cargo.toml
  36. +5 −5 components/net_traits/image/base.rs
  37. +6 −6 components/net_traits/image_cache.rs
  38. +15 −20 components/net_traits/lib.rs
  39. +18 −18 components/net_traits/request.rs
  40. +11 −11 components/net_traits/response.rs
  41. +1 −1 components/net_traits/storage_thread.rs
  42. +1 −1 components/profile_traits/mem.rs
  43. +2 −2 components/range/Cargo.toml
  44. +3 −3 components/range/lib.rs
  45. +4 −4 components/script/Cargo.toml
  46. +1 −1 components/script/body.rs
  47. +3 −3 components/script/document_loader.rs
  48. +1 −1 components/script/dom/bindings/cell.rs
  49. +5 −5 components/script/dom/bindings/codegen/CodegenRust.py
  50. +1 −1 components/script/dom/bindings/error.rs
  51. +1 −1 components/script/dom/bindings/iterable.rs
  52. +4 −4 components/script/dom/bindings/num.rs
  53. +2 −2 components/script/dom/bindings/reflector.rs
  54. +16 −16 components/script/dom/bindings/root.rs
  55. +3 −3 components/script/dom/bindings/str.rs
  56. +6 −6 components/script/dom/bindings/utils.rs
  57. +6 −6 components/script/dom/bindings/weakref.rs
  58. +1 −1 components/script/dom/blob.rs
  59. +2 −2 components/script/dom/bluetooth.rs
  60. +1 −1 components/script/dom/canvasgradient.rs
  61. +4 −4 components/script/dom/canvasrenderingcontext2d.rs
  62. +1 −1 components/script/dom/client.rs
  63. +1 −1 components/script/dom/crypto.rs
  64. +1 −1 components/script/dom/cssfontfacerule.rs
  65. +1 −1 components/script/dom/cssgroupingrule.rs
  66. +1 −1 components/script/dom/cssimportrule.rs
  67. +1 −1 components/script/dom/csskeyframerule.rs
  68. +1 −1 components/script/dom/csskeyframesrule.rs
  69. +1 −1 components/script/dom/cssmediarule.rs
  70. +1 −1 components/script/dom/cssnamespacerule.rs
  71. +1 −1 components/script/dom/cssrulelist.rs
  72. +3 −3 components/script/dom/cssstyledeclaration.rs
  73. +1 −1 components/script/dom/cssstylerule.rs
  74. +1 −1 components/script/dom/cssstylesheet.rs
  75. +1 −1 components/script/dom/csssupportsrule.rs
  76. +1 −1 components/script/dom/cssviewportrule.rs
  77. +16 −16 components/script/dom/customelementregistry.rs
  78. +1 −1 components/script/dom/customevent.rs
  79. +5 −5 components/script/dom/dedicatedworkerglobalscope.rs
  80. +22 −22 components/script/dom/document.rs
  81. +1 −1 components/script/dom/domexception.rs
  82. +6 −6 components/script/dom/element.rs
  83. +1 −1 components/script/dom/errorevent.rs
  84. +4 −4 components/script/dom/event.rs
  85. +5 −5 components/script/dom/eventsource.rs
  86. +19 −19 components/script/dom/eventtarget.rs
  87. +5 −5 components/script/dom/filereader.rs
  88. +1 −1 components/script/dom/gamepad.rs
  89. +6 −6 components/script/dom/globalscope.rs
  90. +2 −2 components/script/dom/headers.rs
  91. +1 −1 components/script/dom/htmlbuttonelement.rs
  92. +1 −1 components/script/dom/htmlcanvaselement.rs
  93. +7 −7 components/script/dom/htmlcollection.rs
  94. +1 −1 components/script/dom/htmldatalistelement.rs
  95. +1 −1 components/script/dom/htmlfieldsetelement.rs
  96. +10 −10 components/script/dom/htmlformelement.rs
  97. +1 −1 components/script/dom/htmlheadingelement.rs
  98. +1 −1 components/script/dom/htmliframeelement.rs
  99. +5 −5 components/script/dom/htmlimageelement.rs
  100. +3 −3 components/script/dom/htmlinputelement.rs
  101. +2 −2 components/script/dom/htmllinkelement.rs
  102. +5 −5 components/script/dom/htmlmediaelement.rs
  103. +1 −1 components/script/dom/htmlmetaelement.rs
  104. +1 −1 components/script/dom/htmlobjectelement.rs
  105. +1 −1 components/script/dom/htmlscriptelement.rs
  106. +1 −1 components/script/dom/htmlselectelement.rs
  107. +1 −1 components/script/dom/htmlstyleelement.rs
  108. +1 −1 components/script/dom/htmltableelement.rs
  109. +1 −1 components/script/dom/htmltextareaelement.rs
  110. +1 −1 components/script/dom/keyboardevent.rs
  111. +1 −1 components/script/dom/medialist.rs
  112. +1 −1 components/script/dom/mediaquerylist.rs
  113. +3 −3 components/script/dom/mutationobserver.rs
  114. +8 −8 components/script/dom/node.rs
  115. +2 −2 components/script/dom/nodeiterator.rs
  116. +3 −3 components/script/dom/nodelist.rs
  117. +2 −2 components/script/dom/paintworkletglobalscope.rs
  118. +2 −2 components/script/dom/performance.rs
  119. +1 −1 components/script/dom/performanceobserver.rs
  120. +1 −1 components/script/dom/popstateevent.rs
  121. +1 −1 components/script/dom/promise.rs
  122. +2 −2 components/script/dom/promisenativehandler.rs
  123. +5 −5 components/script/dom/range.rs
  124. +1 −1 components/script/dom/request.rs
  125. +2 −2 components/script/dom/response.rs
  126. +4 −4 components/script/dom/serviceworkerglobalscope.rs
  127. +15 −15 components/script/dom/servoparser/async_html.rs
  128. +2 −2 components/script/dom/servoparser/html.rs
  129. +6 −6 components/script/dom/servoparser/mod.rs
  130. +2 −2 components/script/dom/servoparser/xml.rs
  131. +4 −4 components/script/dom/testbinding.rs
  132. +1 −1 components/script/dom/textdecoder.rs
  133. +1 −1 components/script/dom/treewalker.rs
  134. +1 −1 components/script/dom/urlhelper.rs
  135. +1 −1 components/script/dom/validitystate.rs
  136. +7 −7 components/script/dom/vrdisplay.rs
  137. +1 −1 components/script/dom/vrdisplaycapabilities.rs
  138. +1 −1 components/script/dom/vreyeparameters.rs
  139. +1 −1 components/script/dom/vrfieldofview.rs
  140. +1 −1 components/script/dom/vrstageparameters.rs
  141. +9 −9 components/script/dom/webgl_extensions/extensions.rs
  142. +7 −5 components/script/dom/webgl_extensions/wrapper.rs
  143. +1 −1 components/script/dom/webgl_validations/types.rs
  144. +1 −1 components/script/dom/webglbuffer.rs
  145. +2 −2 components/script/dom/webglframebuffer.rs
  146. +1 −1 components/script/dom/webglprogram.rs
  147. +1 −1 components/script/dom/webglrenderbuffer.rs
  148. +9 −9 components/script/dom/webglrenderingcontext.rs
  149. +2 −2 components/script/dom/webglshader.rs
  150. +3 −3 components/script/dom/webgltexture.rs
  151. +2 −2 components/script/dom/websocket.rs
  152. +21 −21 components/script/dom/window.rs
  153. +3 −2 components/script/dom/worker.rs
  154. +4 −4 components/script/dom/workerglobalscope.rs
  155. +3 −3 components/script/dom/worklet.rs
  156. +2 −2 components/script/dom/workletglobalscope.rs
  157. +11 −11 components/script/dom/xmlhttprequest.rs
  158. +2 −2 components/script/lib.rs
  159. +10 −6 components/script/mem.rs
  160. +4 −4 components/script/microtask.rs
  161. +7 −3 components/script/script_thread.rs
  162. +4 −4 components/script/textinput.rs
  163. +18 −22 components/script/timers.rs
  164. +2 −2 components/script_layout_interface/Cargo.toml
  165. +6 −6 components/script_layout_interface/lib.rs
  166. +2 −2 components/script_layout_interface/reporter.rs
  167. +3 −3 components/script_traits/Cargo.toml
  168. +16 −20 components/script_traits/lib.rs
  169. +1 −2 components/servo_arc/Cargo.toml
  170. +0 −11 components/servo_arc/lib.rs
  171. +5 −8 components/style/Cargo.toml
  172. +3 −8 components/style/applicable_declarations.rs
  173. +4 −4 components/style/attr.rs
  174. +1 −3 components/style/custom_properties.rs
  175. +1 −1 components/style/dom.rs
  176. +1 −2 components/style/element_state.rs
  177. +4 −10 components/style/invalidation/element/invalidation_map.rs
  178. +1 −3 components/style/invalidation/element/restyle_hints.rs
  179. +2 −6 components/style/invalidation/media_queries.rs
  180. +2 −2 components/style/invalidation/stylesheets.rs
  181. +2 −4 components/style/lib.rs
  182. +1 −1 components/style/logical_geometry.rs
  183. +3 −6 components/style/macros.rs
  184. +5 −5 components/style/media_queries.rs
  185. +2 −6 components/style/properties/declaration_block.rs
  186. +3 −9 components/style/properties/helpers.mako.rs
  187. +13 −15 components/style/properties/helpers/animated_properties.mako.rs
  188. +2 −6 components/style/properties/longhand/background.mako.rs
  189. +4 −12 components/style/properties/longhand/border.mako.rs
  190. +12 −33 components/style/properties/longhand/box.mako.rs
  191. +3 −9 components/style/properties/longhand/counters.mako.rs
  192. +28 −55 components/style/properties/longhand/font.mako.rs
  193. +3 −9 components/style/properties/longhand/inherited_box.mako.rs
  194. +1 −3 components/style/properties/longhand/inherited_svg.mako.rs
  195. +7 −18 components/style/properties/longhand/inherited_text.mako.rs
  196. +2 −6 components/style/properties/longhand/list.mako.rs
  197. +1 −3 components/style/properties/longhand/pointing.mako.rs
  198. +2 −6 components/style/properties/longhand/position.mako.rs
  199. +1 −3 components/style/properties/longhand/table.mako.rs
  200. +4 −12 components/style/properties/longhand/text.mako.rs
  201. +1 −3 components/style/properties/longhand/ui.mako.rs
  202. +8 −18 components/style/properties/properties.mako.rs
  203. +3 −8 components/style/rule_tree/mod.rs
  204. +2 −6 components/style/selector_map.rs
  205. +2 −3 components/style/selector_parser.rs
  206. +7 −7 components/style/servo/media_queries.rs
  207. +1 −4 components/style/servo/restyle_damage.rs
  208. +4 −4 components/style/servo/selector_parser.rs
  209. +2 −1 components/style/servo/url.rs
  210. +2 −2 components/style/shared_lock.rs
  211. +4 −4 components/style/stylesheet_set.rs
  212. +5 −13 components/style/stylesheets/keyframes_rule.rs
  213. +3 −5 components/style/stylesheets/origin.rs
  214. +1 −3 components/style/stylesheets/rule_parser.rs
  215. +3 −3 components/style/stylesheets/stylesheet.rs
  216. +4 −4 components/style/stylesheets/viewport_rule.rs
  217. +13 −18 components/style/stylist.rs
  218. +2 −2 components/style/values/animated/color.rs
  219. +2 −2 components/style/values/animated/effects.rs
  220. +2 −3 components/style/values/computed/angle.rs
  221. +1 −3 components/style/values/computed/color.rs
  222. +2 −6 components/style/values/computed/font.rs
  223. +1 −3 components/style/values/computed/image.rs
  224. +8 −15 components/style/values/computed/length.rs
  225. +4 −6 components/style/values/computed/mod.rs
  226. +2 −3 components/style/values/computed/percentage.rs
  227. +2 −3 components/style/values/computed/time.rs
  228. +1 −3 components/style/values/generics/background.rs
  229. +8 −24 components/style/values/generics/basic_shape.rs
  230. +5 −15 components/style/values/generics/border.rs
  231. +1 −3 components/style/values/generics/box.rs
  232. +4 −9 components/style/values/generics/effects.rs
  233. +1 −1 components/style/values/generics/flex.rs
  234. +10 −30 components/style/values/generics/grid.rs
  235. +12 −32 components/style/values/generics/image.rs
  236. +9 −18 components/style/values/generics/mod.rs
  237. +1 −3 components/style/values/generics/position.rs
  238. +1 −3 components/style/values/generics/rect.rs
  239. +1 −3 components/style/values/generics/size.rs
  240. +7 −18 components/style/values/generics/svg.rs
  241. +3 −9 components/style/values/generics/text.rs
  242. +3 −9 components/style/values/generics/transform.rs
  243. +4 −10 components/style/values/mod.rs
  244. +2 −3 components/style/values/specified/align.rs
  245. +2 −3 components/style/values/specified/angle.rs
  246. +1 −3 components/style/values/specified/border.rs
  247. +1 −3 components/style/values/specified/calc.rs
  248. +2 −6 components/style/values/specified/color.rs
  249. +1 −3 components/style/values/specified/effects.rs
  250. +2 −6 components/style/values/specified/font.rs
  251. +1 −1 components/style/values/specified/grid.rs
  252. +1 −3 components/style/values/specified/image.rs
  253. +11 −33 components/style/values/specified/length.rs
  254. +6 −18 components/style/values/specified/mod.rs
  255. +1 −3 components/style/values/specified/percentage.rs
  256. +1 −3 components/style/values/specified/position.rs
  257. +2 −6 components/style/values/specified/time.rs
  258. +1 −3 components/style/values/specified/transform.rs
  259. +1 −3 components/style_traits/Cargo.toml
  260. +2 −3 components/style_traits/cursor.rs
  261. +3 −5 components/style_traits/lib.rs
  262. +2 −4 components/style_traits/values.rs
  263. +2 −2 components/style_traits/viewport.rs
  264. +3 −3 components/url/Cargo.toml
  265. +7 −4 components/url/lib.rs
  266. +3 −3 components/url/origin.rs
  267. +1 −1 components/webdriver_server/Cargo.toml
  268. +4 −4 ports/geckolib/glue.rs
  269. +1 −1 tests/unit/net/Cargo.toml

Large diffs are not rendered by default.

@@ -10,7 +10,7 @@ build = "build.rs"
path = "lib.rs"

[dependencies]
string_cache = {version = "0.6", features = ["heapsize"]}
string_cache = {version = "0.6"}

[build-dependencies]
string_cache_codegen = "0.4"
@@ -12,10 +12,10 @@ path = "lib.rs"
[dependencies]
cssparser = "0.22.0"
euclid = "0.15"
heapsize = "0.4"
heapsize_derive = "0.1"
ipc-channel = "0.9"
lazy_static = "0.2"
malloc_size_of = { path = "../malloc_size_of" }
malloc_size_of_derive = { path = "../malloc_size_of_derive" }
nonzero = {path = "../nonzero"}
offscreen_gl_context = { version = "0.11", features = ["serde"] }
serde = "1.0"
@@ -82,13 +82,13 @@ pub enum FromScriptMsg {
SendPixels(IpcSender<Option<Vec<u8>>>),
}

#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)]
pub struct CanvasGradientStop {
pub offset: f64,
pub color: RGBA,
}

#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)]
pub struct LinearGradientStyle {
pub x0: f64,
pub y0: f64,
@@ -110,7 +110,7 @@ impl LinearGradientStyle {
}
}

#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)]
pub struct RadialGradientStyle {
pub x0: f64,
pub y0: f64,
@@ -165,7 +165,7 @@ pub enum FillOrStrokeStyle {
Surface(SurfaceStyle),
}

#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
#[derive(Clone, Copy, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub enum LineCapStyle {
Butt = 0,
Round = 1,
@@ -185,7 +185,7 @@ impl FromStr for LineCapStyle {
}
}

#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
#[derive(Clone, Copy, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub enum LineJoinStyle {
Round = 0,
Bevel = 1,
@@ -227,7 +227,7 @@ impl FromStr for RepetitionStyle {
}
}

#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
#[derive(Clone, Copy, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub enum CompositionStyle {
SrcIn,
SrcOut,
@@ -281,7 +281,7 @@ impl CompositionStyle {
}
}

#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
#[derive(Clone, Copy, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub enum BlendingStyle {
Multiply,
Screen,
@@ -347,7 +347,7 @@ impl BlendingStyle {
}
}

#[derive(Clone, Copy, Deserialize, HeapSizeOf, PartialEq, Serialize)]
#[derive(Clone, Copy, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub enum CompositionOrBlending {
Composition(CompositionStyle),
Blending(BlendingStyle),
@@ -9,10 +9,10 @@

extern crate cssparser;
extern crate euclid;
extern crate heapsize;
#[macro_use] extern crate heapsize_derive;
extern crate ipc_channel;
#[macro_use] extern crate lazy_static;
extern crate malloc_size_of;
#[macro_use] extern crate malloc_size_of_derive;
extern crate nonzero;
extern crate offscreen_gl_context;
#[macro_use] extern crate serde;
@@ -64,7 +64,7 @@ pub struct WebGLCreateContextResult {
pub share_mode: WebGLContextShareMode,
}

#[derive(Clone, Copy, Deserialize, HeapSizeOf, Serialize)]
#[derive(Clone, Copy, Deserialize, MallocSizeOf, Serialize)]
pub enum WebGLContextShareMode {
/// Fast: a shared texture_id is used in WebRender.
SharedTexture,
@@ -73,10 +73,10 @@ pub enum WebGLContextShareMode {
}

/// Helper struct to send WebGLCommands to a specific WebGLContext.
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)]
pub struct WebGLMsgSender {
ctx_id: WebGLContextId,
#[ignore_heap_size_of = "channels are hard"]
#[ignore_malloc_size_of = "channels are hard"]
sender: WebGLChan,
}

@@ -313,8 +313,8 @@ macro_rules! define_resource_id {
}
}

impl ::heapsize::HeapSizeOf for $name {
fn heap_size_of_children(&self) -> usize { 0 }
impl ::malloc_size_of::MallocSizeOf for $name {
fn size_of(&self, _ops: &mut ::malloc_size_of::MallocSizeOfOps) -> usize { 0 }
}
}
}
@@ -327,13 +327,10 @@ define_resource_id!(WebGLProgramId);
define_resource_id!(WebGLShaderId);
define_resource_id!(WebGLVertexArrayId);

#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, MallocSizeOf, Ord)]
#[derive(PartialEq, PartialOrd, Serialize)]
pub struct WebGLContextId(pub usize);

impl ::heapsize::HeapSizeOf for WebGLContextId {
fn heap_size_of_children(&self) -> usize { 0 }
}

#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
pub enum WebGLError {
InvalidEnum,
@@ -11,11 +11,11 @@ path = "lib.rs"

[dependencies]
bitflags = "0.7"
heapsize = "0.4"
heapsize_derive = "0.1"
hyper = "0.10"
hyper_serde = "0.7"
ipc-channel = "0.9"
malloc_size_of = { path = "../malloc_size_of" }
malloc_size_of_derive = { path = "../malloc_size_of_derive" }
msg = {path = "../msg"}
serde = "1.0"
servo_url = {path = "../url"}
@@ -14,10 +14,10 @@

#[macro_use]
extern crate bitflags;
extern crate heapsize;
#[macro_use] extern crate heapsize_derive;
extern crate hyper;
extern crate ipc_channel;
extern crate malloc_size_of;
#[macro_use] extern crate malloc_size_of_derive;
extern crate msg;
#[macro_use] extern crate serde;
extern crate servo_url;
@@ -40,7 +40,7 @@ pub struct DevtoolsPageInfo {
pub url: ServoUrl,
}

#[derive(Clone, Debug, Deserialize, HeapSizeOf, Serialize)]
#[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
pub struct CSSError {
pub filename: String,
pub line: u32,
@@ -144,7 +144,7 @@ pub struct TimelineMarker {
pub end_stack: Option<Vec<()>>,
}

#[derive(Clone, Debug, Deserialize, Eq, Hash, HeapSizeOf, PartialEq, Serialize)]
#[derive(Clone, Debug, Deserialize, Eq, Hash, MallocSizeOf, PartialEq, Serialize)]
pub enum TimelineMarkerType {
Reflow,
DOMEvent,
@@ -355,5 +355,5 @@ impl PreciseTime {
}
}

#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, HeapSizeOf, PartialEq, Serialize)]
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, MallocSizeOf, PartialEq, Serialize)]
pub struct WorkerId(pub u32);
@@ -15,7 +15,7 @@ pub fn dom_struct(args: TokenStream, input: TokenStream) -> TokenStream {
panic!("#[dom_struct] takes no arguments");
}
let attributes = quote! {
#[derive(DenyPublicFields, DomObject, HeapSizeOf, JSTraceable)]
#[derive(DenyPublicFields, DomObject, JSTraceable, MallocSizeOf)]
#[must_root]
#[repr(C)]
};
@@ -12,4 +12,5 @@ path = "lib.rs"
[dependencies]
app_units = "0.5"
euclid = "0.15"
heapsize = "0.4"
malloc_size_of = { path = "../malloc_size_of" }
malloc_size_of_derive = { path = "../malloc_size_of_derive" }
@@ -4,7 +4,8 @@

extern crate app_units;
extern crate euclid;
#[macro_use] extern crate heapsize;
extern crate malloc_size_of;
#[macro_use] extern crate malloc_size_of_derive;

use app_units::{Au, MAX_AU, MIN_AU};
use euclid::{Point2D, Rect, Size2D};
@@ -24,11 +25,9 @@ use euclid::{Point2D, Rect, Size2D};
///
/// The ratio between DeviceIndependentPixel and DevicePixel for a given display be found by calling
/// `servo::windowing::WindowMethods::hidpi_factor`.
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, MallocSizeOf)]
pub enum DeviceIndependentPixel {}

known_heap_size!(0, DeviceIndependentPixel);

// An Au is an "App Unit" and represents 1/60th of a CSS pixel. It was
// originally proposed in 2002 as a standard unit of measure in Gecko.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=177805 for more info.
@@ -21,12 +21,12 @@ fnv = "1.0"
fontsan = {git = "https://github.com/servo/fontsan"}
gfx_traits = {path = "../gfx_traits"}
harfbuzz-sys = "0.1"
heapsize = "0.4"
heapsize_derive = "0.1"
ipc-channel = "0.9"
lazy_static = "0.2"
libc = "0.2"
log = "0.3.5"
malloc_size_of = { path = "../malloc_size_of" }
malloc_size_of_derive = { path = "../malloc_size_of_derive" }
msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
ordered-float = "0.4"

0 comments on commit 4506f0d

Please sign in to comment.
You can’t perform that action at this time.