diff options
author | Dan Gohman <gohman@apple.com> | 2009-08-27 01:25:57 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-08-27 01:25:57 +0000 |
commit | 5b78d50cadf5df4948e8e5798a3e08e0ccf4cb06 (patch) | |
tree | 492b9f667169a24fd421456e59e963b0e3d8e30f /lib/ExecutionEngine/JIT/JITMemoryManager.cpp | |
parent | cdbb3f5d3311e0f46d22bc8daa211b2fab3541cb (diff) |
Initialize the PoisonMemory member before initializing
members that call methods that read the PoisonMemory member.
This fixes potential spurious (though probably otherwise
harmless) poising of unused memory, and fixes the
associated valgrind error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80192 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/JITMemoryManager.cpp')
-rw-r--r-- | lib/ExecutionEngine/JIT/JITMemoryManager.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/ExecutionEngine/JIT/JITMemoryManager.cpp b/lib/ExecutionEngine/JIT/JITMemoryManager.cpp index e750768d25..474843f066 100644 --- a/lib/ExecutionEngine/JIT/JITMemoryManager.cpp +++ b/lib/ExecutionEngine/JIT/JITMemoryManager.cpp @@ -556,16 +556,16 @@ void JITSlabAllocator::Deallocate(MemSlab *Slab) { } DefaultJITMemoryManager::DefaultJITMemoryManager() - : LastSlab(0, 0), - BumpSlabAllocator(*this), - StubAllocator(DefaultSlabSize, DefaultSizeThreshold, BumpSlabAllocator), - DataAllocator(DefaultSlabSize, DefaultSizeThreshold, BumpSlabAllocator) { - + : #ifdef NDEBUG - PoisonMemory = false; + PoisonMemory(false), #else - PoisonMemory = true; + PoisonMemory(true), #endif + LastSlab(0, 0), + BumpSlabAllocator(*this), + StubAllocator(DefaultSlabSize, DefaultSizeThreshold, BumpSlabAllocator), + DataAllocator(DefaultSlabSize, DefaultSizeThreshold, BumpSlabAllocator) { // Allocate space for code. sys::MemoryBlock MemBlock = allocateNewSlab(DefaultCodeSlabSize); |