[webkit-reviews] review granted: [Bug 183357] [WTF] Set canInitializeWithMemset = true if T is an integral type : [Attachment 335098] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 7 20:07:57 PST 2018


Darin Adler <darin at apple.com> has granted Yusuke Suzuki
<utatane.tea at gmail.com>'s request for review:
Bug 183357: [WTF] Set canInitializeWithMemset = true if T is an integral type
https://bugs.webkit.org/show_bug.cgi?id=183357

Attachment 335098: Patch

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




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

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

> Source/WTF/wtf/Vector.h:71
> +    static void initializeIfNecessary(T*, T*) { }

I am not sure what "if necessary" means here. I think a C++ expert would call
this initializeUnlessConstructorIsTrivial or
initializeIfConstructorIsNonTrivial.

> Source/WTF/wtf/VectorTraits.h:52
> +	   static const bool canInitializeWithMemset =
std::is_integral<T>::value;

Why can’t we just set this to true? Are there types that return true for is_pod
and can’t be initialized with memset?


More information about the webkit-reviews mailing list