Bug 234056 - Use thread safe initialization for statics in Font::getCFStringAttributes
Summary: Use thread safe initialization for statics in Font::getCFStringAttributes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Cameron McCormack (:heycam)
URL:
Keywords: InRadar
Depends on:
Blocks: 233488
  Show dependency treegraph
 
Reported: 2021-12-08 18:34 PST by Cameron McCormack (:heycam)
Modified: 2022-07-20 20:12 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.65 KB, patch)
2021-12-08 18:35 PST, Cameron McCormack (:heycam)
darin: review+
Details | Formatted Diff | Diff
Patch (3.25 KB, patch)
2022-07-20 14:43 PDT, Matt Woodrow
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].