[llvm-commits] [llvm] r142410 - /llvm/trunk/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
Jim Grosbach
grosbach at apple.com
Tue Oct 18 12:57:38 PDT 2011
Author: grosbach
Date: Tue Oct 18 14:57:38 2011
New Revision: 142410
URL: http://llvm.org/viewvc/llvm-project?rev=142410&view=rev
Log:
The MCJITMemoryManager takes ownership of the JMM, so don't leak it.
Modified:
llvm/trunk/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
Modified: llvm/trunk/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h?rev=142410&r1=142409&r2=142410&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h (original)
+++ llvm/trunk/lib/ExecutionEngine/MCJIT/MCJITMemoryManager.h Tue Oct 18 14:57:38 2011
@@ -27,6 +27,8 @@
Module *M;
public:
MCJITMemoryManager(JITMemoryManager *jmm, Module *m) : JMM(jmm), M(m) {}
+ // We own the JMM, so make sure to delete it.
+ ~MCJITMemoryManager() { delete JMM; }
// Allocate ActualSize bytes, or more, for the named function. Return
// a pointer to the allocated memory and update Size to reflect how much
More information about the llvm-commits
mailing list