gecko-dev/servo
Hiroyuki Ikezoe 0b9b61abdd Bug 1418806 - Try to allocate possible size for AnimationValueMap before composing. r=birtles
The EffectSet count does not exactly represent the count what we really need
for AnimationValueMap, but in most cases it matches.  For example;

1) The element has two different keyframes animations

 @keyframes anim1 {
   to { opacity: 0; }
 }
 @keyframes anim2 {
   to { transform: rotate(360deg); }
 }

 In this case the number matches.

2) The element has two animations but both keyframes have the same CSS property

 @keyframes anim1 {
   to { opacity: 0; }
 }
 @keyframes anim2 {
   to { opacity: 0.1; }
 }

 In this case the number doesn't match, moreover it results more memory than we
 ever needed, but this case is presumably less common.

3) The element has an animation having keyframes for two different CSS
   properties.

 @keyframes anim {
   from { opacity: 0; transform: rotate(360deg); }
 }

 In this kind of cases, the number doesn't match.  But even so, this patch
 reduces the opportunities that the AnimationValueMap tries to allocate a new
 memory (i.e. less opportunities on expanding the map).

Note that when the hash map is expanded, we do allocate a new RawTable with the
new size then replace the old one with the new one [1], so I believe this
change will reduce the crash rate to some extent.

[1] https://hg.mozilla.org/mozilla-central/file/15c95df467be/servo/components/hashglobe/src/hash_map.rs#l734

MozReview-Commit-ID: 6tcF9aqXh7a

--HG--
extra : rebase_source : 366989d3a2756f5a5711503a57f42f3b746d93a5
2018-06-26 11:08:24 +09:00
..
components Bug 1418806 - Try to allocate possible size for AnimationValueMap before composing. r=birtles 2018-06-26 11:08:24 +09:00
ports/geckolib Bug 1470145: Better debugging for stylesheets and URLs. r=xidorn 2018-06-22 02:33:07 +02:00
support/gecko/nsstring Bug 1464834: Remove dead servo code. r=xidorn,heycam 2018-05-29 10:28:11 +02:00
tests/unit No bug - Fix or remove some unit tests that are not building. 2018-06-23 20:46:14 +02:00
moz.build Bug 1464834: Bring back servo/moz.build to fix the linting failure. r=me 2018-05-29 11:07:31 +02:00