Add support for malloc and alloc_size attributes
Created attachment 145883 [details] Patch
Why?
Attachment 145883 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WTF/ChangeLog', u'Source/WTF/wtf/Co..." exit_code: 1 Source/WTF/wtf/FastMalloc.h:32: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
(In reply to comment #2) > Why? The malloc attribute is used by compilers for optimizations purposes. It allows the compiler to decide that a pointer returned by such functions cannot alias anything. The alloc_size attribute allows the compilers to emit warnings and/or add run-time instrumentation to catch buffer overflows. GCC can emit warnings based on this attribute, and clang has experimental support to instrument code to detect buffer overflows.
Comment on attachment 145883 [details] Patch Attachment 145883 [details] did not pass gtk-ews (gtk): Output: http://queues.webkit.org/results/12901618
Comment on attachment 145883 [details] Patch Attachment 145883 [details] did not pass win-ews (win): Output: http://queues.webkit.org/results/12893708
Comment on attachment 145883 [details] Patch Attachment 145883 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/12896696
Created attachment 145891 [details] Patch #2 This new patch should fix the build for non-clang compilers.
Created attachment 145892 [details] Patch #3 sorry for the churn. I forgot the 'patch' flag on the previous attachment.
Attachment 145892 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WTF/ChangeLog', u'Source/WTF/wtf/Co..." exit_code: 1 Source/WTF/wtf/FastMalloc.h:32: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.