WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
234484
[WTF] Remove RefCountedArray and use RefCountedFixedVector
https://bugs.webkit.org/show_bug.cgi?id=234484
Summary
[WTF] Remove RefCountedArray and use RefCountedFixedVector
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
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Yusuke Suzuki
Comment 1
2021-12-18 21:38:06 PST
Created
attachment 447540
[details]
Patch
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
<
rdar://problem/86760816
>
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.
Top of Page
Format For Printing
XML
Clone This Bug