mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-22 10:24:26 +00:00
[Allocator] Remove a really problematic overload. This is very confusing
because there is another (size_t, size_t) overload of Allocator, and the only distinguishing factor is that one is a tempalte and the other isn't. There was only one usage of this and that one was easily converted to carry the alignment constraint in the type itself. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206325 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -88,14 +88,6 @@ public:
|
|||||||
return static_cast<T *>(Allocate(Num * sizeof(T), AlignOf<T>::Alignment));
|
return static_cast<T *>(Allocate(Num * sizeof(T), AlignOf<T>::Alignment));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Allocate space for an array of objects with the specified alignment
|
|
||||||
/// and without constructing them.
|
|
||||||
template <typename T> T *Allocate(size_t Num, size_t Alignment) {
|
|
||||||
// Round EltSize up to the specified alignment.
|
|
||||||
size_t EltSize = (sizeof(T) + Alignment - 1) & (-Alignment);
|
|
||||||
return static_cast<T *>(Allocate(Num * EltSize, Alignment));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// \brief Deallocate space for one object without destroying it.
|
/// \brief Deallocate space for one object without destroying it.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
typename std::enable_if<
|
typename std::enable_if<
|
||||||
|
Reference in New Issue
Block a user