From: Mon P Wang Date: Tue, 10 Mar 2009 23:04:40 +0000 (+0000) Subject: Fixed rounding up EltSize X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=cabb383aba8a4ce3691cbcd9a42fc7b136b7feed;p=oota-llvm.git Fixed rounding up EltSize git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66594 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/Allocator.h b/include/llvm/Support/Allocator.h index 9ca02efb1f6..4a04ccc382e 100644 --- a/include/llvm/Support/Allocator.h +++ b/include/llvm/Support/Allocator.h @@ -77,7 +77,7 @@ public: template 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(Allocate(Num * EltSize, Alignment)); }