Bug 261985
| Summary: | style checker gives error if makeUnique isn't used, but that isn't always a possibility | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Jean-Yves Avenard [:jya] <jean-yves.avenard> |
| Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=261033 | ||
Jean-Yves Avenard [:jya]
makeUnique requires that the object being allocated contains the type'webkitFastMalloced' added by the macro `WTF_MAKE_FAST_ALLOCATED` and others.
When dealing with system frameworks or 3rd party libraries it is not always possible to use makeUnique to allocate an object, and only std::make_unique<T> will do.
Yet, the style checker will give you a red-tick with errors like:
`Use 'WTF::makeUnique<AudioFormatVorbisModeInfo>' instead of 'std::make_unique<AudioFormatVorbisModeInfo>'. [runtime/wtf_make_unique] [4]`
I created bug 261033 for having makeUnique deals with all objects, however, one could argue that if makeUnique worked with all objects, it would give no advantages over std::make_unique.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/115916181>
Jean-Yves Avenard [:jya]
looks like we have to use makeUniqueWithoutFastMallocCheck