Bug 261985 - style checker gives error if makeUnique isn't used, but that isn't always a possibility
Summary: style checker gives error if makeUnique isn't used, but that isn't always a p...
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-22 17:03 PDT by Jean-Yves Avenard [:jya]
Modified: 2023-10-18 06:17 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Yves Avenard [:jya] 2023-09-22 17:03:55 PDT
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.
Comment 1 Radar WebKit Bug Importer 2023-09-22 17:04:15 PDT
<rdar://problem/115916181>
Comment 2 Jean-Yves Avenard [:jya] 2023-09-29 21:35:30 PDT
looks like we have to use makeUniqueWithoutFastMallocCheck