Bug 234056

Summary: Use thread safe initialization for statics in Font::getCFStringAttributes
Product: WebKit Reporter: Cameron McCormack (:heycam) <heycam>
Component: Layout and RenderingAssignee: Cameron McCormack (:heycam) <heycam>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, darin, mattwoodrow, mmaxfield, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=234102
Bug Depends on:    
Bug Blocks: 233488    
Attachments:
Description Flags
Patch
darin: review+
Patch none

Description Cameron McCormack (:heycam) 2021-12-08 18:34:19 PST
Use thread safe initialization for statics in Font::getCFStringAttributes
Comment 1 Cameron McCormack (:heycam) 2021-12-08 18:35:02 PST
Created attachment 446476 [details]
Patch
Comment 2 Cameron McCormack (:heycam) 2021-12-08 18:35:54 PST
This is another one where the benefit of avoiding allocating these objects might be overwhelmed by the lines of code to do the caching.
Comment 3 Darin Adler 2021-12-08 19:02:28 PST
Comment on attachment 446476 [details]
Patch

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

> Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp:46
> +static CFNumberRef zeroKerningValue()

This function just returns a float zero. I don’t think its name should include "kerning value". It can be reused by anyone who needs a 0.0f as a CFNumber.
Comment 4 Cameron McCormack (:heycam) 2021-12-09 23:53:27 PST
This too won't be needed if bug 234102 works.
Comment 5 Radar WebKit Bug Importer 2021-12-15 18:35:16 PST
<rdar://problem/86553412>
Comment 6 Matt Woodrow 2022-07-20 14:43:08 PDT
Created attachment 461058 [details]
Patch
Comment 7 EWS 2022-07-20 20:12:33 PDT
Committed 252677@main (070a876c5310): <https://commits.webkit.org/252677@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 461058 [details].