Bug 223227 - RunLoop::isMain() should not need to do any heap allocations
Summary: RunLoop::isMain() should not need to do any heap allocations
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks: 223226
  Show dependency treegraph
 
Reported: 2021-03-15 17:20 PDT by Chris Dumez
Modified: 2021-03-16 14:33 PDT (History)
9 users (show)

See Also:


Attachments
Patch (2.95 KB, patch)
2021-03-15 17:23 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2021-03-15 17:20:54 PDT
RunLoop::isMain() should not need to do any heap allocations.
Comment 1 Chris Dumez 2021-03-15 17:23:08 PDT
Created attachment 423268 [details]
Patch
Comment 2 EWS 2021-03-15 18:57:06 PDT
Committed r274458: <https://commits.webkit.org/r274458>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 423268 [details].
Comment 3 Radar WebKit Bug Importer 2021-03-15 18:58:18 PDT
<rdar://problem/75458639>
Comment 4 Alexey Proskuryakov 2021-03-16 08:37:26 PDT
Comment on attachment 423268 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=423268&action=review

> Source/WTF/wtf/RunLoop.cpp:65
> +auto RunLoop::runLoopHolder() -> ThreadSpecific<Holder>&

Is this style better?
Comment 5 Chris Dumez 2021-03-16 08:42:24 PDT
(In reply to Alexey Proskuryakov from comment #4)
> Comment on attachment 423268 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=423268&action=review
> 
> > Source/WTF/wtf/RunLoop.cpp:65
> > +auto RunLoop::runLoopHolder() -> ThreadSpecific<Holder>&
> 
> Is this style better?

I use it whenever it makes the type shorter. I would have needed to use 'ThreadSpecific<RunLoop::Holder>&' otherwise. I don't think we have a style rule either way but I have seen other people (including Darin) use it in such cases.
Comment 6 Darin Adler 2021-03-16 14:33:40 PDT
(In reply to Chris Dumez from comment #5)
> I use it whenever it makes the type shorter.

Yes, I do it whenever it makes the type significantly shorter.