<html dir="ltr"><head></head><body style="text-align: left; direction: ltr; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div>Hi,</div><div><br></div><div>I'm working on a runtime autotuner that utilizes ORCv2 JIT (I'm closely tracking tip-of-tree), so linking new object files and patching in the new function(s) will happen frequently. </div><div><br></div><div>One of the concerns my runtime system has is the ability to do one of the following: (1) replacement of the contents of a JITDylib with a new object file [to provide semi-space GC-style reclaiming], (2) the outright removal of a JITDylib.</div><div><br></div><div>Right now, I have one ExecutionSession instance for my linker and am creating a new JITDylib for each object file that I'd like to link in. There doesn't appear to be a corresponding ExecutionSession::removeJITDylib(..) method, so I'm wondering: how do I reclaim the memory for code that I've linked in previously but no longer need?</div><div><br></div><div>When using MCJIT, I would reclaim this memory by destroying the ExecutionEngine that was created for each "JITDylib". Should I do the same with ExecutionSessions?</div><div><br></div><div>For reference, here's the short bit of code I'm playing with for linking with ORC: </div><div><a href="https://github.com/halo-project/llvm/blob/master/compiler-rt/lib/halomon/DynamicLinker.h#L55">https://github.com/halo-project/llvm/blob/master/compiler-rt/lib/halomon/DynamicLinker.h#L55</a></div><div><br></div><div>Thanks,</div><div>Kavon</div></body></html>