[llvm-commits] [llvm] r80192 - /llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
Dan Gohman
gohman at apple.com
Wed Aug 26 18:25:57 PDT 2009
Author: djg
Date: Wed Aug 26 20:25:57 2009
New Revision: 80192
URL: http://llvm.org/viewvc/llvm-project?rev=80192&view=rev
Log:
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.
Modified:
llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp?rev=80192&r1=80191&r2=80192&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/JITMemoryManager.cpp Wed Aug 26 20:25:57 2009
@@ -556,16 +556,16 @@
}
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);
More information about the llvm-commits
mailing list