diff options
| author | Dan Gohman <gohman@apple.com> | 2008-06-30 21:33:02 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2008-06-30 21:33:02 +0000 |
| commit | 2b11690e9f1530e031cb8965c53419275efbbd16 (patch) | |
| tree | ccfced8e46bea71838407e3e2e84886325a8ae10 /llvm | |
| parent | a76e60a77a093be86e843d2268e0ae995815c5ff (diff) | |
| download | bcm5719-llvm-2b11690e9f1530e031cb8965c53419275efbbd16.tar.gz bcm5719-llvm-2b11690e9f1530e031cb8965c53419275efbbd16.zip | |
Use plain operator new instead of new char[].
llvm-svn: 52927
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/ADT/SmallVector.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h index 715f28c2796..3d1640cb571 100644 --- a/llvm/include/llvm/ADT/SmallVector.h +++ b/llvm/include/llvm/ADT/SmallVector.h @@ -84,7 +84,7 @@ public: // If this wasn't grown from the inline copy, deallocate the old space. if (!isSmall()) - delete[] reinterpret_cast<char*>(Begin); + operator delete(static_cast<void*>(Begin)); } typedef size_t size_type; @@ -317,8 +317,8 @@ private: /// isSmall - Return true if this is a smallvector which has not had dynamic /// memory allocated for it. bool isSmall() const { - return reinterpret_cast<const void*>(Begin) == - reinterpret_cast<const void*>(&FirstEl); + return static_cast<const void*>(Begin) == + static_cast<const void*>(&FirstEl); } /// grow - double the size of the allocated memory, guaranteeing space for at @@ -346,7 +346,7 @@ void SmallVectorImpl<T>::grow(size_t MinSize) { size_t NewCapacity = 2*CurCapacity; if (NewCapacity < MinSize) NewCapacity = MinSize; - T *NewElts = reinterpret_cast<T*>(new char[NewCapacity*sizeof(T)]); + T *NewElts = static_cast<T*>(operator new(NewCapacity*sizeof(T))); // Copy the elements over. std::uninitialized_copy(Begin, End, NewElts); @@ -356,7 +356,7 @@ void SmallVectorImpl<T>::grow(size_t MinSize) { // If this wasn't grown from the inline copy, deallocate the old space. if (!isSmall()) - delete[] reinterpret_cast<char*>(Begin); + operator delete(static_cast<void*>(Begin)); Begin = NewElts; End = NewElts+CurSize; |

