WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
REOPENED
294022
Remove MallocPtr.
https://bugs.webkit.org/show_bug.cgi?id=294022
Summary
Remove MallocPtr.
Keith Miller
Reported
2025-06-04 07:07:56 PDT
We should remove this class, it's just a giant footgun at this point. In particular, if the type doesn't have a destructor it's effectively the same as std::unique_ptr. If it does have a destructor then we should very very likely be running that destructor. Adding `static_assert(std::is_trivially_destructible<T>())` to `MallocPtr` lead me to at least two memory leaks in JSC and who knows how many more in WebCore+. These probably happen because the class didn't need a destructor at first then someone adds a member that needs destruction but `MallocPtr` doesn't complain.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2025-06-04 07:08:32 PDT
<
rdar://problem/152575154
>
Vassili Bykov
Comment 2
2025-06-12 11:36:24 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/46668
EWS
Comment 3
2025-07-17 14:14:39 PDT
Committed
297550@main
(a892900ddc21): <
https://commits.webkit.org/297550@main
> Reviewed commits have been landed. Closing PR #46668 and removing active labels.
WebKit Commit Bot
Comment 4
2025-07-17 15:33:13 PDT
Re-opened since this is blocked by
bug 296151
Vassili Bykov
Comment 5
2025-07-22 10:33:36 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/48375
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