Skip to content

x86: Fix leak of OrcX86Target on initialization completion

amyspark requested to merge amyspark/orc:fix-leak-orctarget-x86 into main

Hi,

There's a bit that has been nagging me in the x86 support, namely how we use calloc to create the OrcTarget per-instruction set. This is obviously leaked on app close and is liable to ASAN.

Switching the ownership of the OrcTarget to the individual instruction sets is enough to enable the removal of that stray calloc.

Question: given the change needed in orc_x86_register_target which is already ABI breaking, would it be better to forward declare the function inside each architecture, or remove orcx86.h et al. from the install list altogether?

Merge request reports

Loading