Remove non-portable optimization that isn't worth it
authorChris Lattner <sabre@nondot.org>
Wed, 12 Jul 2006 00:31:47 +0000 (00:31 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 12 Jul 2006 00:31:47 +0000 (00:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29115 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/JIT/JIT.cpp

index 2bf0e13baf4a65ce07c43b11c0dddc2653afc463..d2d8b4995307ab068e8c81e026a9874bf4f173c4 100644 (file)
@@ -309,11 +309,7 @@ void *JIT::getOrEmitGlobalVariable(const GlobalVariable *GV) {
       // space.
       Ptr = malloc(S+A);
       unsigned MisAligned = ((intptr_t)Ptr & (A-1));
-      unsigned Offset = MisAligned ? (A-MisAligned) : 0;
-      
-      // Trim the tail off the memory block.
-      realloc(Ptr, S+Offset);
-      Ptr = (char*)Ptr + Offset;
+      Ptr = (char*)Ptr + (MisAligned ? (A-MisAligned) : 0);
     }
     state.getPendingGlobals(locked).push_back(GV);
   }