Bug 223227

Summary: RunLoop::isMain() should not need to do any heap allocations
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Web Template FrameworkAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, ap, benjamin, cmarcelo, darin, ews-watchlist, ggaren, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 223226    
Attachments:
Description Flags
Patch none

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.