RESOLVED FIXED 143747
JavaScriptCore: Use kCFAllocatorDefault where possible
https://bugs.webkit.org/show_bug.cgi?id=143747
Summary JavaScriptCore: Use kCFAllocatorDefault where possible
Joseph Pecoraro
Reported 2015-04-14 18:25:07 PDT
* SUMMARY Use kCFAllocatorDefault instead of NULL/0/nullptr where possible. This came up as a review comment for one of my changes. There are only a few in JSC, the other frameworks can be addressed separately later.
Attachments
[PATCH] Proposed Fix (3.40 KB, patch)
2015-04-14 18:26 PDT, Joseph Pecoraro
no flags
Joseph Pecoraro
Comment 1 2015-04-14 18:26:27 PDT
Created attachment 250771 [details] [PATCH] Proposed Fix
Alexey Proskuryakov
Comment 2 2015-04-14 18:42:25 PDT
I'm curious what the rationale is. Isn't 0 slightly faster?
Joseph Pecoraro
Comment 3 2015-04-14 18:50:18 PDT
(In reply to comment #2) > I'm curious what the rationale is. Isn't 0 slightly faster? My rationale was "consistency and readability". In cases where the first parameter is an allocator, then specifying kCFAllocatorDefault removes any ambiguity that may exist if "0" or "nullptr" was used for the first argument. That said, I don't really have strong opinions on this. It was brought up in a review on one of my patches.
Darin Adler
Comment 4 2015-04-15 10:08:11 PDT
Comment on attachment 250771 [details] [PATCH] Proposed Fix This is the clearest and most correct way to write it, but oh so wordy. In my non-WebKit code I almost always used NULL for this.
WebKit Commit Bot
Comment 5 2015-04-15 10:56:49 PDT
Comment on attachment 250771 [details] [PATCH] Proposed Fix Clearing flags on attachment: 250771 Committed r182847: <http://trac.webkit.org/changeset/182847>
WebKit Commit Bot
Comment 6 2015-04-15 10:56:52 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.