mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 14:25:08 +00:00
![]() 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 :^) |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
IDLGenerators.cpp | ||
IDLParser.cpp | ||
IDLParser.h | ||
IDLTypes.h | ||
main.cpp |