Enforce size constraints on various data structures in JavaScriptCore/wtf.
Created attachment 56418 [details] Patch
This is a start of helping to automatically enforce memory constraints on key data structures. The idea for doing this comes from https://bugs.webkit.org/show_bug.cgi?id=38906#c5 and that it would be good to detect issues like this automatically at build time. This patch only addresses wtf items. (A future one could address some WebCore items.)
Created attachment 56744 [details] Proposed fix (same as last time, just updated to not have conflicts with things that have landed).
Attachment 56744 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style', '--no-squash']" exit_code: 1 JavaScriptCore/wtf/WTFCompileAsserts.cpp:33: Found other header before a header this file implements. Should be: config.h, primary header, blank line, and then alphabetically sorted. [build/include_order] [4] Total errors found: 1 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
(In reply to comment #4) > Failed to run "['WebKitTools/Scripts/check-webkit-style', '--no-squash']" exit_code: 1 > JavaScriptCore/wtf/WTFCompileAsserts.cpp:33: Found other header before a header this file implements. Should be: config.h, primary header, blank line, and then alphabetically sorted. [build/include_order] [4] > Total errors found: 1 in 6 files > > If any of these errors are false positives, please file a bug against check-webkit-style. Done: https://bugs.webkit.org/show_bug.cgi?id=39514
This seems like a great idea. Anders Carlsson and I have talked about going even further.
Comment on attachment 56744 [details] Proposed fix (same as last time, just updated to not have conflicts with things that have landed). > +++ b/JavaScriptCore/wtf/WTFCompileAsserts.cpp It seems strange to have WTF in the filename here. Also, I think they are assertions, not "asserts". If the intent here is to have these be size assertions only, then I think the file name is not quite right.
(In reply to comment #7) > (From update of attachment 56744 [details]) > > +++ b/JavaScriptCore/wtf/WTFCompileAsserts.cpp > > It seems strange to have WTF in the filename here. Also, I think they are assertions, not "asserts". > > If the intent here is to have these be size assertions only, then I think the file name is not quite right. How about SizeLimits.cpp ? This is a cpp file which contains size constraints/limits for data structures in WTF (that don't have their own cpp file).
(In reply to comment #8) > How about SizeLimits.cpp ? Sounds pretty good to me.
http://trac.webkit.org/changeset/59969 might have broken Chromium Linux Release
(In reply to comment #10) > http://trac.webkit.org/changeset/59969 might have broken Chromium Linux Release Fix this and Snow Leopard, here http://trac.webkit.org/changeset/59970 (by removing one compile assert for the moment for cross thread ref counted -- I'll look to add this one back in the future).
Looks like this can be closed.