[LLVMdev] Lifetime of ExecutionEngine?

Kaylor, Andrew andrew.kaylor at intel.com
Fri Oct 26 17:11:48 PDT 2012

Yes, in that case it's probably OK to delete it.  The only other concern that comes to mind is that the ExecutionEngine also takes ownership of the Module object it is compiling, so that will be deleted too.  If that's not a problem for you, then it should be OK to delete the ExecutionEngine.


-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Paul J. Lucas
Sent: Friday, October 26, 2012 4:56 PM
To: llvmdev at cs.uiuc.edu List
Subject: Re: [LLVMdev] Lifetime of ExecutionEngine?

On Oct 26, 2012, at 12:59 PM, "Kaylor, Andrew" <andrew.kaylor at intel.com> wrote:

> In either case, deleting the ExecutionEngine should result in the JITMemoryManager being deleted and therefore also the memory in which the JITed functions are contained.
> I think it's entirely possible that you just aren't seeing a problem because that memory hasn't been recycled yet.  It's a problem waiting to happen.

I probably should have mentioned that I'm JIT'ing the function, executing it, deleting the ExecutionEngine, and (the part I left out) never executing the JIT'd function again.  It's only ever executed once.  Given that, I would think it would be OK to delete the ExecutionEngine -- yes?

- Paul

LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu

More information about the llvm-dev mailing list