<div dir="rtl"><div dir="ltr">Hi Andy,</div><div dir="ltr"><br></div><div dir="ltr">Here is the patch. it incorporates:</div><div dir="ltr"><br></div><div dir="ltr">1) your latest patch to SVN.</div><div dir="ltr">2) mcjit-module-state-optimization.patch.</div>

<div dir="ltr">3) the PtrSet changes.</div><div dir="ltr"><br></div><div dir="ltr">Other than the OwnedModules implementation there were other differences between 1) and 2), especially in the Finalize* functions, so please review that I got the right code.</div>

<div dir="ltr"><br></div><div dir="ltr">I got bitten by subtle bugs arising from MCJIT inheriting from EE: </div><div dir="ltr">First, MCJIT overridden addModule but not removeModule so the EE version was called. Second, both MCJIT and EE constructors take ownership of the module and their destructors try to delete it. Fixed this with a hack in MCJIT destructor and a FIXME comment, the real fix is simply getting EE out of the picture. It just interferes.</div>

<div dir="ltr">I know it's in the plans, yet more reasons to do so.</div><div dir="ltr"><br></div><div dir="ltr">Finally, I don't know if there are good multi-module test cases. I have run only my one-module use-case (currently - I'm having other-than-MCJIT issues with multiple modules) with the code and after fixing the above bugs the code, debugged line by line, appear to work OK.</div>

<div dir="ltr"><br></div><div dir="ltr">Yaron</div><div dir="ltr"><br></div></div>