1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 14:25:08 +00:00
serenity/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator
DexesTTP 2ab8d474c6 Lagom: Fix leaks in the IDL Wrapper generator
By using RefPtrs to handle interfaces, the IDL parser could store cyclic
references to interfaces that import each other. One main example is the
"EventTarget.idl" and the "AbortSignal.idl" files, which both reference
each other. This caused huge amounts of memory not to be freed on exit.

To fix this, the parsed IDL interfaces are now stored in a HashTable of
NonnullOwnPtr<Interface>, which serves as the sole reference for every
parsed interface. All other usages of the Interface are changed to use
references instead of RefPtrs, or occasionally as raw pointers where
references don't fit inside the data structures.

This new HashTable is static, and as such will automatically be freed
prior to exiting the generator. This ensures that the code generator
properly cleans up after itself.

With this change, The IDL code generators can properly run on Lagom when
compiled with the -DENABLE_ADDRESS_SANITIZER=ON flag, and gets compiled
properly on the CI :^)
2022-05-25 22:25:09 +01:00
..
CMakeLists.txt Meta: Split and refactor the WrapperGenerator a bit 2022-02-17 19:55:27 +01:00
IDLGenerators.cpp LibWeb: Verify argument_check before generating if statement 2022-04-05 22:33:44 +02:00
IDLParser.cpp Lagom: Fix leaks in the IDL Wrapper generator 2022-05-25 22:25:09 +01:00
IDLParser.h Lagom: Fix leaks in the IDL Wrapper generator 2022-05-25 22:25:09 +01:00
IDLTypes.h Lagom: Fix leaks in the IDL Wrapper generator 2022-05-25 22:25:09 +01:00
main.cpp Lagom: Fix leaks in the IDL Wrapper generator 2022-05-25 22:25:09 +01:00