Bug 234484

Summary: [WTF] Remove RefCountedArray and use RefCountedFixedVector
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, benjamin, cdumez, cmarcelo, darin, dino, ews-watchlist, gyuyoung.kim, mmaxfield, ryuan.choi, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Yusuke Suzuki
Reported 2021-12-18 21:35:40 PST
[WTF] Remove RefCountedArray and use RefCountedFixedVector
Attachments
Patch (28.33 KB, patch)
2021-12-18 21:38 PST, Yusuke Suzuki
no flags
Yusuke Suzuki
Comment 1 2021-12-18 21:38:06 PST
Yusuke Suzuki
Comment 2 2021-12-21 02:02:46 PST
Comment on attachment 447540 [details] Patch Thanks!
Darin Adler
Comment 3 2021-12-21 02:10:57 PST
Related: In new code should start making our argument types and return types be Span<> instead of const Vector<>& or const FixedVector<>&. Find to still have argument types that are Vector<>&& or FixedVector<>&&, and return types that are Vector<> or FixedVector<>, but not references, because Span is more flexible and can return things from a std::array<>, a Vector<>, a FixedVector<>, a pointer to a single value, or a subspan of any of those. I think we’ll end up with better code.
EWS
Comment 4 2021-12-21 02:34:16 PST
Committed r287308 (245460@main): <https://commits.webkit.org/245460@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 447540 [details].
Radar WebKit Bug Importer
Comment 5 2021-12-21 02:35:18 PST
Yusuke Suzuki
Comment 6 2021-12-21 02:40:22 PST
(In reply to Darin Adler from comment #3) > Related: In new code should start making our argument types and return types > be Span<> instead of const Vector<>& or const FixedVector<>&. Find to still > have argument types that are Vector<>&& or FixedVector<>&&, and return types > that are Vector<> or FixedVector<>, but not references, because Span is more > flexible and can return things from a std::array<>, a Vector<>, a > FixedVector<>, a pointer to a single value, or a subspan of any of those. I > think we’ll end up with better code. Yeah, Span<> is useful, and we can probably use it more! But in this case, we are using RefCountedFixedVector (not FixedVector) intentionally here since FontCascadeDescription shares RefCountedFixedVector of the other FontCascadeDescription. And the existing method is returning `RefCountedFixedVector&` (previously, `RefCountedArray&`) to pass it to the other FontCascadeDescription sharing it. (that's why this is ref-counted, and neither Vector nor FixedVector).
Note You need to log in before you can comment on or make changes to this bug.