mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
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. llvm-svn: 80192
This commit is contained in:
parent
984f8efcaa
commit
1725fdd25d
@ -556,17 +556,17 @@ void JITSlabAllocator::Deallocate(MemSlab *Slab) {
|
||||
}
|
||||
|
||||
DefaultJITMemoryManager::DefaultJITMemoryManager()
|
||||
: LastSlab(0, 0),
|
||||
:
|
||||
#ifdef NDEBUG
|
||||
PoisonMemory(false),
|
||||
#else
|
||||
PoisonMemory(true),
|
||||
#endif
|
||||
LastSlab(0, 0),
|
||||
BumpSlabAllocator(*this),
|
||||
StubAllocator(DefaultSlabSize, DefaultSizeThreshold, BumpSlabAllocator),
|
||||
DataAllocator(DefaultSlabSize, DefaultSizeThreshold, BumpSlabAllocator) {
|
||||
|
||||
#ifdef NDEBUG
|
||||
PoisonMemory = false;
|
||||
#else
|
||||
PoisonMemory = true;
|
||||
#endif
|
||||
|
||||
// Allocate space for code.
|
||||
sys::MemoryBlock MemBlock = allocateNewSlab(DefaultCodeSlabSize);
|
||||
CodeSlabs.push_back(MemBlock);
|
||||
|
Loading…
Reference in New Issue
Block a user