Title: [154990] trunk/Source/WTF
Revision
154990
Author
mikhail.pozdnya...@intel.com
Date
2013-09-03 10:33:22 -0700 (Tue, 03 Sep 2013)

Log Message

Check WTF::VectorFiller template argument type size in compile time
https://bugs.webkit.org/show_bug.cgi?id=120631

Reviewed by Darin Adler.

The template argument's type size in WTF::VectorFiller 'memset' specialization
should be checked during compilation rather than in runtime.

* wtf/Vector.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (154989 => 154990)


--- trunk/Source/WTF/ChangeLog	2013-09-03 17:08:13 UTC (rev 154989)
+++ trunk/Source/WTF/ChangeLog	2013-09-03 17:33:22 UTC (rev 154990)
@@ -1,3 +1,15 @@
+2013-09-03  Mikhail Pozdnyakov  <mikhail.pozdnya...@intel.com>
+
+        Check WTF::VectorFiller template argument type size in compile time
+        https://bugs.webkit.org/show_bug.cgi?id=120631
+
+        Reviewed by Darin Adler.
+
+        The template argument's type size in WTF::VectorFiller 'memset' specialization
+        should be checked during compilation rather than in runtime.
+
+        * wtf/Vector.h:
+
 2013-09-02  Darin Adler  <da...@apple.com>
 
         Cut down on double hashing and code needlessly using hash table iterators

Modified: trunk/Source/WTF/wtf/Vector.h (154989 => 154990)


--- trunk/Source/WTF/wtf/Vector.h	2013-09-03 17:08:13 UTC (rev 154989)
+++ trunk/Source/WTF/wtf/Vector.h	2013-09-03 17:33:22 UTC (rev 154990)
@@ -174,7 +174,7 @@
     {
         static void uninitializedFill(T* dst, T* dstEnd, const T& val) 
         {
-            ASSERT(sizeof(T) == sizeof(char));
+            COMPILE_ASSERT(sizeof(T) == sizeof(char), Size_of_type_should_be_equal_to_one);
 #if COMPILER(GCC) && defined(_FORTIFY_SOURCE)
             if (!__builtin_constant_p(dstEnd - dst) || (!(dstEnd - dst)))
 #endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to