[webkit-reviews] review granted: [Bug 224586] Use WTF::Function instead of std::function in SVGPropertyAnimatorFactory::attributeAnimatorCreator : [Attachment 426068] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 15 08:49:05 PDT 2021


Darin Adler <darin at apple.com> has granted Alex Christensen
<achristensen at apple.com>'s request for review:
Bug 224586: Use WTF::Function instead of std::function in
SVGPropertyAnimatorFactory::attributeAnimatorCreator
https://bugs.webkit.org/show_bug.cgi?id=224586

Attachment 426068: Patch

https://bugs.webkit.org/attachment.cgi?id=426068&action=review




--- Comment #4 from Darin Adler <darin at apple.com> ---
Comment on attachment 426068
  --> https://bugs.webkit.org/attachment.cgi?id=426068
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=426068&action=review

> Source/WebCore/ChangeLog:9
> +	   sizeof(WTF::Function<void()>) is 8.
> +	   sizeof(std::function<void()>) is 48.

What about total memory use? I’m wondering if we should even allow
std::function if it uses more memory, but maybe this is more about "what's in
the top level of the object and what's on the heap"?

> Source/WebCore/svg/properties/SVGPropertyAnimatorFactory.h:112
> +	       Pair { SVGNames::colorAttr->impl(),	       
std::make_pair(SVGValueProperty<Color>::create,
SVGPropertyAnimatorFactory::createColorAnimator) },

Is there a good reason we are using std::make_pair instead of just brace
syntax? Could we make this even tighter?


More information about the webkit-reviews mailing list