Bug 294022
| Summary: | Remove MallocPtr. | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Keith Miller <keith_miller> |
| Component: | Web Template Framework | Assignee: | Vassili Bykov <v_bykov> |
| Status: | REOPENED | ||
| Severity: | Normal | CC: | commit-queue, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 296151 | ||
| Bug Blocks: | |||
Keith Miller
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
<rdar://problem/152575154>
Vassili Bykov
Pull request: https://github.com/WebKit/WebKit/pull/46668
EWS
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
Re-opened since this is blocked by bug 296151
Vassili Bykov
Pull request: https://github.com/WebKit/WebKit/pull/48375