[webkit-reviews] review granted: [Bug 208367] Add document about WTF malloc-related macros : [Attachment 397037] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 20 17:47:29 PDT 2020


Darin Adler <darin at apple.com> has granted Yusuke Suzuki <ysuzuki at apple.com>'s
request for review:
Bug 208367: Add document about WTF malloc-related macros
https://bugs.webkit.org/show_bug.cgi?id=208367

Attachment 397037: Patch

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




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

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

I love the idea of having comments. The shorter and simpler this can be, the
better. Already good.

> Source/WTF/wtf/FastMalloc.h:37
> +//	2. If your class / struct is JavaScript exposed one, use
WTF_MAKE_ISO_ALLOCATED.

I don’t know what "JavaScript exposed" means. Maybe we could be more specific
and mechanical on how we can tell if a class or struct is "JavaScript exposed"?

> Source/WTF/wtf/FastMalloc.h:47
> +//	  Because of performance and memory footprint, we encourage using
FastMalloc for all the class / struct allocations if possible.

The issue is that if we don’t use WTF_MAKE_FAST_ALLOCATED then new/delete will
use operator new/delete, which will use system malloc. And we want to minimize
the use of system malloc, because bmalloc offers better performance and memory
footprint. But that’s not stated here.


More information about the webkit-reviews mailing list