mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 19:31:58 +00:00
Fixed rounding up EltSize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66594 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
20cb46287c
commit
cabb383aba
@ -77,7 +77,7 @@ public:
|
||||
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));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user