RESOLVED FIXED 152902
Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL
https://bugs.webkit.org/show_bug.cgi?id=152902
Summary Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL
Andreas Kling
Reported 2016-01-08 10:55:14 PST
We should use NeverDestroyed everywhere instead of DEPRECATED_DEFINE_STATIC_LOCAL, to ameliorate heap fragmentation from lazily instantiated statics.
Attachments
Patch (255.04 KB, patch)
2016-01-08 11:12 PST, Andreas Kling
no flags
Patch (255.68 KB, patch)
2016-01-08 11:43 PST, Andreas Kling
no flags
Patch (256.32 KB, patch)
2016-01-08 11:57 PST, Andreas Kling
no flags
Patch (257.08 KB, patch)
2016-01-08 12:34 PST, Andreas Kling
no flags
Patch (258.61 KB, patch)
2016-01-08 12:49 PST, Andreas Kling
no flags
Patch (259.25 KB, patch)
2016-01-08 13:23 PST, Andreas Kling
andersca: review+
Patch (259.48 KB, patch)
2016-01-08 13:50 PST, Andreas Kling
no flags
Patch (260.59 KB, patch)
2016-01-08 20:45 PST, Andreas Kling
no flags
Patch 2 (convert some more code) (20.23 KB, patch)
2016-01-09 15:03 PST, Andreas Kling
no flags
Patch 2 (convert some more code) (21.00 KB, patch)
2016-01-09 17:18 PST, Andreas Kling
aestes: review+
Patch 2 for landing (20.67 KB, patch)
2016-01-10 04:38 PST, Andreas Kling
no flags
Chris Dumez
Comment 1 2016-01-08 10:55:52 PST
Yes please
Andreas Kling
Comment 2 2016-01-08 11:12:01 PST
Created attachment 268554 [details] Patch Almost all done with regex, let's see what EWS thinks..
WebKit Commit Bot
Comment 3 2016-01-08 11:13:25 PST
Attachment 268554 [details] did not pass style-queue: ERROR: Source/WebCore/platform/network/HTTPParsers.cpp:39: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/WebCore/platform/audio/ios/AudioDestinationIOS.cpp:44: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/WebCore/page/ContentSecurityPolicy.cpp:49: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/WebCore/platform/graphics/GraphicsLayer.cpp:38: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/WebCore/rendering/style/RenderStyle.h:72: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 5 in 174 files If any of these errors are false positives, please file a bug against check-webkit-style.
Andreas Kling
Comment 4 2016-01-08 11:43:23 PST
Andreas Kling
Comment 5 2016-01-08 11:57:37 PST
Andreas Kling
Comment 6 2016-01-08 12:34:44 PST
Andreas Kling
Comment 7 2016-01-08 12:49:31 PST
Andreas Kling
Comment 8 2016-01-08 13:23:55 PST
Andreas Kling
Comment 9 2016-01-08 13:50:11 PST
Andreas Kling
Comment 10 2016-01-08 20:45:51 PST
WebKit Commit Bot
Comment 11 2016-01-09 05:14:00 PST
Comment on attachment 268608 [details] Patch Clearing flags on attachment: 268608 Committed r194819: <http://trac.webkit.org/changeset/194819>
WebKit Commit Bot
Comment 12 2016-01-09 05:14:05 PST
All reviewed patches have been landed. Closing bug.
Andreas Kling
Comment 13 2016-01-09 15:03:24 PST
Reopening to attach more patch.
Andreas Kling
Comment 14 2016-01-09 15:03:54 PST
Created attachment 268628 [details] Patch 2 (convert some more code)
WebKit Commit Bot
Comment 15 2016-01-09 15:05:06 PST
Attachment 268628 [details] did not pass style-queue: ERROR: Source/WebCore/svg/properties/SVGAnimatedPropertyMacros.h:98: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm:68: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 2 in 20 files If any of these errors are false positives, please file a bug against check-webkit-style.
Andreas Kling
Comment 16 2016-01-09 17:18:55 PST
Created attachment 268634 [details] Patch 2 (convert some more code)
WebKit Commit Bot
Comment 17 2016-01-09 17:21:07 PST
Attachment 268634 [details] did not pass style-queue: ERROR: Source/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h:33: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/WebCore/svg/properties/SVGAnimatedPropertyMacros.h:98: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 2 in 21 files If any of these errors are false positives, please file a bug against check-webkit-style.
Andy Estes
Comment 18 2016-01-09 17:46:41 PST
Comment on attachment 268634 [details] Patch 2 (convert some more code) View in context: https://bugs.webkit.org/attachment.cgi?id=268634&action=review > Source/WebCore/svg/properties/SVGAnimatedPropertyMacros.h:92 > + static NeverDestroyed<const SVGPropertyInfo> s_propertyInfo = SVGPropertyInfo \ Why the " = SVGPropertyInfo"? > Source/WebKit/mac/Misc/WebNSPasteboardExtras.mm:71 > - DEPRECATED_DEFINE_STATIC_LOCAL(RetainPtr<NSArray>, types, ([[NSArray alloc] initWithObjects: > + static NeverDestroyed<RetainPtr<NSArray>> types([[NSArray alloc] initWithObjects: > WebURLsWithTitlesPboardType, > NSURLPboardType, > WebURLPboardType, > WebURLNamePboardType, > NSStringPboardType, > - nil])); > - return types.get(); > + nil]); > + return types.get().get(); Even better here would be a plain old static NSArray * storing a leaked value. > Source/WebKit/mac/Misc/WebNSPasteboardExtras.mm:84 > - DEPRECATED_DEFINE_STATIC_LOCAL(RetainPtr<NSArray>, types, (_createWritableTypesForImageWithoutArchive())); > - return types.get(); > + static NeverDestroyed<RetainPtr<NSArray>> types(_createWritableTypesForImageWithoutArchive()); > + return types.get().get(); Ditto. > Source/WebKit/mac/Misc/WebNSPasteboardExtras.mm:98 > - DEPRECATED_DEFINE_STATIC_LOCAL(RetainPtr<NSArray>, types, (_createWritableTypesForImageWithArchive())); > - return types.get(); > + static NeverDestroyed<RetainPtr<NSArray>> types(_createWritableTypesForImageWithArchive()); > + return types.get().get(); Ditto.
Andreas Kling
Comment 19 2016-01-10 04:38:52 PST
Created attachment 268644 [details] Patch 2 for landing
WebKit Commit Bot
Comment 20 2016-01-10 04:41:38 PST
Attachment 268644 [details] did not pass style-queue: ERROR: Source/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h:33: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/WebCore/svg/properties/SVGAnimatedPropertyMacros.h:98: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 2 in 21 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Commit Bot
Comment 21 2016-01-10 05:27:58 PST
Comment on attachment 268644 [details] Patch 2 for landing Clearing flags on attachment: 268644 Committed r194826: <http://trac.webkit.org/changeset/194826>
WebKit Commit Bot
Comment 22 2016-01-10 05:28:03 PST
All reviewed patches have been landed. Closing bug.
Chris Dumez
Comment 23 2016-01-12 09:27:05 PST
Looks like this was a decent PLT regression: <rdar://problem/24150482>
WebKit Commit Bot
Comment 24 2016-01-12 10:10:48 PST
Re-opened since this is blocked by bug 153020
Chris Dumez
Comment 25 2016-01-13 15:02:00 PST
Note You need to log in before you can comment on or make changes to this bug.