For extra sanity checking, fill free'd memory with garbage so we know that
authorChris Lattner <sabre@nondot.org>
Fri, 12 May 2006 00:03:12 +0000 (00:03 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 12 May 2006 00:03:12 +0000 (00:03 +0000)
people aren't reusing machine code buffers at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28228 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/JIT/JITEmitter.cpp

index efc2062a544e9a3ba359d6a42d39dc913077a8c5..2a62bd3557c5f95c848fa42592090826cf8138f3 100644 (file)
@@ -321,6 +321,9 @@ namespace {
       MemoryRangeHeader *MemRange = I->second;
       assert(MemRange->ThisAllocated && "Block isn't allocated!");
       
+      // Fill the buffer with garbage!
+      DEBUG(memset(MemRange+1, 0xCD, MemRange->BlockSize-sizeof(*MemRange)));
+      
       // Free the memory.
       FreeMemoryList = MemRange->FreeBlock(FreeMemoryList);