diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-12-13 16:04:04 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-12-13 16:04:04 +0000 |
commit | 53bd3d0b1a0ae5550578c7b341a7f55e620d8773 (patch) | |
tree | 00e9b6c7953dadffcfc784b93139d92bf3b16277 /llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp | |
parent | a125162bb0306a92cce3f03e9e837f98f2cbb032 (diff) | |
download | bcm5719-llvm-53bd3d0b1a0ae5550578c7b341a7f55e620d8773.tar.gz bcm5719-llvm-53bd3d0b1a0ae5550578c7b341a7f55e620d8773.zip |
Get rid of some leaks found by VC leak detector.
Patch contributed by Morten Ofsted.
llvm-svn: 18889
Diffstat (limited to 'llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp b/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp index eff24de89e3..66034330159 100644 --- a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp +++ b/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp @@ -51,6 +51,7 @@ namespace { unsigned char *CurStubPtr, *CurFunctionPtr; public: JITMemoryManager(); + ~JITMemoryManager(); inline unsigned char *allocateStub(unsigned StubSize); inline unsigned char *startFunctionBody(); @@ -69,6 +70,10 @@ JITMemoryManager::JITMemoryManager() { CurStubPtr = CurFunctionPtr = FunctionBase; } +JITMemoryManager::~JITMemoryManager() { + sys::Memory::ReleaseRWX(MemBlock); +} + unsigned char *JITMemoryManager::allocateStub(unsigned StubSize) { CurStubPtr -= StubSize; if (CurStubPtr < MemBase) { |