Bug 180042 - check-webkit-style should detect missing WTF_MAKE_ISO_ALLOCATED/WTF_MAKE_ISO_ALLOCATED_IMPL macros
Summary: check-webkit-style should detect missing WTF_MAKE_ISO_ALLOCATED/WTF_MAKE_ISO_...
Status: NEW
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:
Depends on: 178108
Blocks:
  Show dependency treegraph
 
Reported: 2017-11-27 10:07 PST by David Kilzer (:ddkilzer)
Modified: 2017-11-27 10:12 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2017-11-27 10:07:59 PST
In Bug 178108, isolated heaps were introduced for all render tree objects.  However, at least one class was missed (fixed by Bug 180010).

It would be really useful to have a check-webkit-style checker that warns when WTF_MAKE_ISO_ALLOCATED or WTF_MAKE_ISO_ALLOCATED_IMPL are missing from a new or existing class.
Comment 1 David Kilzer (:ddkilzer) 2017-11-27 10:12:48 PST
One way to do this would be to match on class name (since we want all Render* classes to opt into ISO heaps), but that won't work if other classes start opting in as well.

A better approach may be to figure out how to preprocess the header file (thus pulling in the base class declaration), and then check the base class declaration of the new/modified subclass to see if it's missing the WTF_MAKE_ISO_ALLOCATED macro.

To check for the need for the WTF_MAKE_ISO_ALLOCATED_IMPL macro, we just need to check that the header file contains a WTF_MAKE_ISO_ALLOCATED macro within its class declaration.

Obviously, the checker should check for both conditions: (a) using a macro when it shouldn't be used, and (b) omitting a macro when it should be used.