diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2013-10-24 09:52:56 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2013-10-24 09:52:56 +0000 |
commit | d55d159d09912b72728d9767d6cdaac36bade7dc (patch) | |
tree | 34809e0e1ab5527fd5eecb116459d5478bb304cf /llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp | |
parent | 741e6ef4d48989262721eb02932fe706930475dd (diff) | |
download | bcm5719-llvm-d55d159d09912b72728d9767d6cdaac36bade7dc.tar.gz bcm5719-llvm-d55d159d09912b72728d9767d6cdaac36bade7dc.zip |
Revert part of r193291, restoring the deletion of loaded objects.
Without this, customers of the MCJIT were leaking memory like crazy.
It's not really clear what the *right* memory management is here, so I'm
not trying to add lots of tests or other logic, just trying to get us
back to a better baseline. I'll follow up on the original commit to
figure out the right path forward.
llvm-svn: 193323
Diffstat (limited to 'llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp index a6405947aba..da4164e6476 100644 --- a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp +++ b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp @@ -76,6 +76,15 @@ MCJIT::~MCJIT() { // Modules.clear(); Dyld.deregisterEHFrames(); + + LoadedObjectMap::iterator it, end = LoadedObjects.end(); + for (it = LoadedObjects.begin(); it != end; ++it) { + ObjectImage *Obj = it->second; + if (Obj) { + NotifyFreeingObject(*Obj); + delete Obj; + } + } LoadedObjects.clear(); delete TM; } |