[llvm-commits] [llvm] r66597 - /llvm/branches/Apple/Dib/include/llvm/Support/Allocator.h

Bill Wendling isanbard at gmail.com
Tue Mar 10 16:38:09 PDT 2009


Author: void
Date: Tue Mar 10 18:38:06 2009
New Revision: 66597

URL: http://llvm.org/viewvc/llvm-project?rev=66597&view=rev
Log:
--- Merging (from foreign repository) r66594 into '.':
U    include/llvm/Support/Allocator.h

Fixed rounding up EltSize

Modified:
    llvm/branches/Apple/Dib/include/llvm/Support/Allocator.h

Modified: llvm/branches/Apple/Dib/include/llvm/Support/Allocator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/include/llvm/Support/Allocator.h?rev=66597&r1=66596&r2=66597&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/include/llvm/Support/Allocator.h (original)
+++ llvm/branches/Apple/Dib/include/llvm/Support/Allocator.h Tue Mar 10 18:38:06 2009
@@ -77,7 +77,7 @@
   template <typename T>
   T *Allocate(size_t Num, unsigned Alignment) { 
     // Round EltSize up to the specified alignment.
-    unsigned EltSize = (sizeof(T)+Alignment-1)&~Alignment;
+    unsigned EltSize = (sizeof(T)+Alignment-1)&(-Alignment);
     return static_cast<T*>(Allocate(Num * EltSize, Alignment));
   }
   





More information about the llvm-commits mailing list