gecko-dev/servo/components
Nicholas Nethercote 5a62942911 servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin
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`.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix https://bugzilla.mozilla.org/show_bug.cgi?id=1409255

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because testing is on the Gecko side.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 4c538b642e4bdfbf42c522c5a59c258a6d14546e

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : f9a6feed1088d0b0be2b55d7f0c2ec9c594ac33b
2017-10-18 13:56:05 -05:00
..
atoms servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
bluetooth servo: Merge #18890 - Update WR (details below): (from glennw:update-wr-clip-text-aa); r=jdm 2017-10-16 12:54:02 -05:00
bluetooth_traits servo: Merge #18890 - Update WR (details below): (from glennw:update-wr-clip-text-aa); r=jdm 2017-10-16 12:54:02 -05:00
canvas servo: Merge #18592 - Implement DOM to texture (from MortimerGoro:dom_texture); r=jdm 2017-10-16 15:36:42 -05:00
canvas_traits servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
compositing servo: Merge #18704 - Switch to using WebRender hit testing (from mrobinson:wr-hit-testing); r=jdm,glennw,mbrubeck 2017-10-17 17:09:25 -05:00
config servo: Merge #18924 - Fix commonmark Markdown warnings in docs, part 1 (from mbrubeck:doc); r=Manishearth 2017-10-17 16:04:10 -05:00
constellation servo: Merge #18704 - Switch to using WebRender hit testing (from mrobinson:wr-hit-testing); r=jdm,glennw,mbrubeck 2017-10-17 17:09:25 -05:00
debugger
deny_public_fields servo: Merge #17514 - deny_public_fields: display field identifier in help message (from HarveyHunt:deny-public-fields-error-message); r=jdm 2017-06-25 10:45:42 -07:00
devtools servo: Merge #18890 - Update WR (details below): (from glennw:update-wr-clip-text-aa); r=jdm 2017-10-16 12:54:02 -05:00
devtools_traits servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
dom_struct servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
domobject_derive servo: Merge #18204 - Fix quote dependency version (from servo:quote); r=bustage 2017-08-23 12:13:18 -05:00
fallible servo: Merge #18661 - Bug 1400754 - stylo: crash on Win64 Asan build. r=manishearth, dmajor (from julian-seward1:master); r=emilio 2017-10-03 06:06:14 -05:00
geometry servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
gfx servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
gfx_traits servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
hashglobe servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
jstraceable_derive servo: Merge #18204 - Fix quote dependency version (from servo:quote); r=bustage 2017-08-23 12:13:18 -05:00
layout servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
layout_thread servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
layout_traits servo: Merge #18890 - Update WR (details below): (from glennw:update-wr-clip-text-aa); r=jdm 2017-10-16 12:54:02 -05:00
lru_cache servo: Merge #18589 - Plumbing for the nth-index cache (from bholley:nth_index_plumbing); r=emilio 2017-09-21 01:24:01 -05:00
malloc_size_of servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
malloc_size_of_derive servo: Merge #18452 - Overhaul MallocSizeOf and related things (from nnethercote:bug-1398737); r=jdm 2017-09-11 22:11:25 -05:00
metrics servo: Merge #18890 - Update WR (details below): (from glennw:update-wr-clip-text-aa); r=jdm 2017-10-16 12:54:02 -05:00
msg servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
net servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
net_traits servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
nonzero servo: Merge #18875 - Remove the need for rust-mozjs to use unstable Rust features (from servo:stable-js); r=nox,jdm 2017-10-16 17:07:50 -05:00
profile servo: Merge #18890 - Update WR (details below): (from glennw:update-wr-clip-text-aa); r=jdm 2017-10-16 12:54:02 -05:00
profile_traits servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
rand
range servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
remutex servo: Merge #18875 - Remove the need for rust-mozjs to use unstable Rust features (from servo:stable-js); r=nox,jdm 2017-10-16 17:07:50 -05:00
script servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
script_layout_interface servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
script_plugins servo: Merge #18839 - Remove some usage of unstable features (from servo:stabler); r=nox 2017-10-12 05:18:00 -05:00
script_traits servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
selectors servo: Merge #18924 - Fix commonmark Markdown warnings in docs, part 1 (from mbrubeck:doc); r=Manishearth 2017-10-17 16:04:10 -05:00
servo servo: Merge #18914 - Update WR (hit test relative point, query feature) (from glennw:update-wr-hit-test); r=KiChjang 2017-10-16 23:42:12 -05:00
servo_arc servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
size_of_test servo: Merge #16870 - Add size_of tests for geckolib selectors (from servo:size_of); r=emilio 2017-05-16 04:00:30 -05:00
style servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
style_derive servo: Merge #18300 - style: Remove HasViewportPercentage (from emilio:die-hvp-die); r=nox 2017-08-30 04:31:11 -05:00
style_traits servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
url servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
webdriver_server servo: Merge #18938 - Replace all uses of the heapsize crate with malloc_size_of (from nnethercote:bug-1409255); r=SimonSapin 2017-10-18 13:56:05 -05:00
webvr servo: Merge #18890 - Update WR (details below): (from glennw:update-wr-clip-text-aa); r=jdm 2017-10-16 12:54:02 -05:00
webvr_traits servo: Merge #18890 - Update WR (details below): (from glennw:update-wr-clip-text-aa); r=jdm 2017-10-16 12:54:02 -05:00