Bug 234192 - Add a std::nullptr_t constructor for RefPtr
Summary: Add a std::nullptr_t constructor for RefPtr
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Don Olmstead
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-12-10 21:08 PST by Don Olmstead
Modified: 2021-12-14 20:36 PST (History)
22 users (show)

See Also:


Attachments
WIP Patch (8.05 KB, patch)
2021-12-10 21:14 PST, Don Olmstead
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
WIP Patch (9.05 KB, patch)
2021-12-10 23:13 PST, Don Olmstead
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
WIP Patch (9.54 KB, patch)
2021-12-11 08:34 PST, Don Olmstead
no flags Details | Formatted Diff | Diff
Patch (13.19 KB, patch)
2021-12-11 09:31 PST, Don Olmstead
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Don Olmstead 2021-12-10 21:08:18 PST
Both std::unique_ptr and std::shared_ptr have a constexpr default constructor and a constexpr constructor for std::nullptr_t. Do the same with RefPtr.
Comment 1 Don Olmstead 2021-12-10 21:14:57 PST Comment hidden (obsolete)
Comment 2 Don Olmstead 2021-12-10 23:13:16 PST Comment hidden (obsolete)
Comment 3 Don Olmstead 2021-12-11 08:34:02 PST Comment hidden (obsolete)
Comment 4 Don Olmstead 2021-12-11 09:31:04 PST
Created attachment 446892 [details]
Patch
Comment 5 Yusuke Suzuki 2021-12-11 12:09:30 PST
Comment on attachment 446892 [details]
Patch

r=me
Comment 6 EWS 2021-12-11 12:50:17 PST
Committed r286917 (245143@main): <https://commits.webkit.org/245143@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 446892 [details].
Comment 7 Radar WebKit Bug Importer 2021-12-11 12:51:18 PST
<rdar://problem/86368668>
Comment 8 Darin Adler 2021-12-14 20:36:45 PST
I don’t think this patch actually optimizes any generated code because I’m pretty sure the old constructor got inlined and collapsed to just zero-initialization. But I like that this catches us using 0 by accident, and that it's constexpr.