diff options
| author | Dan Gohman <gohman@apple.com> | 2008-07-03 00:59:36 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2008-07-03 00:59:36 +0000 |
| commit | 99e6237ba76ddf0dc610bf2a30b3ee8232af77f9 (patch) | |
| tree | f7fe2fbee1b6372c6f3e48a8938e6398bf8378ea | |
| parent | 7722f791f6563ceb21a07cd1b3905533a3bb3d8b (diff) | |
| download | bcm5719-llvm-99e6237ba76ddf0dc610bf2a30b3ee8232af77f9.tar.gz bcm5719-llvm-99e6237ba76ddf0dc610bf2a30b3ee8232af77f9.zip | |
Use operator new instead of new char[].
llvm-svn: 53067
| -rw-r--r-- | llvm/include/llvm/ADT/DenseMap.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h index 2caec63ee41..fd9edd240fa 100644 --- a/llvm/include/llvm/ADT/DenseMap.h +++ b/llvm/include/llvm/ADT/DenseMap.h @@ -82,7 +82,7 @@ public: P->second.~ValueT(); P->first.~KeyT(); } - delete[] reinterpret_cast<char*>(Buckets); + operator delete(Buckets); } typedef DenseMapIterator<KeyT, ValueT, KeyInfoT> iterator; @@ -210,9 +210,9 @@ private: NumTombstones = other.NumTombstones; if (NumBuckets) - delete[] reinterpret_cast<char*>(Buckets); - Buckets = reinterpret_cast<BucketT*>(new char[sizeof(BucketT) * - other.NumBuckets]); + operator delete(Buckets); + Buckets = static_cast<BucketT*>(operator new(sizeof(BucketT) * + other.NumBuckets)); if (KeyInfoT::isPod() && ValueInfoT::isPod()) memcpy(Buckets, other.Buckets, other.NumBuckets * sizeof(BucketT)); @@ -315,7 +315,7 @@ private: NumBuckets = InitBuckets; assert(InitBuckets && (InitBuckets & (InitBuckets-1)) == 0 && "# initial buckets must be a power of two!"); - Buckets = reinterpret_cast<BucketT*>(new char[sizeof(BucketT)*InitBuckets]); + Buckets = static_cast<BucketT*>(operator new(sizeof(BucketT)*InitBuckets)); // Initialize all the keys to EmptyKey. const KeyT EmptyKey = getEmptyKey(); for (unsigned i = 0; i != InitBuckets; ++i) @@ -330,7 +330,7 @@ private: while (NumBuckets <= AtLeast) NumBuckets <<= 1; NumTombstones = 0; - Buckets = reinterpret_cast<BucketT*>(new char[sizeof(BucketT)*NumBuckets]); + Buckets = static_cast<BucketT*>(operator new(sizeof(BucketT)*NumBuckets)); // Initialize all the keys to EmptyKey. const KeyT EmptyKey = getEmptyKey(); @@ -357,7 +357,7 @@ private: } // Free the old table. - delete[] reinterpret_cast<char*>(OldBuckets); + operator delete(OldBuckets); } void shrink_and_clear() { @@ -368,7 +368,7 @@ private: NumBuckets = NumEntries > 32 ? 1 << (Log2_32_Ceil(NumEntries) + 1) : 64; NumTombstones = 0; - Buckets = reinterpret_cast<BucketT*>(new char[sizeof(BucketT)*NumBuckets]); + Buckets = static_cast<BucketT*>(operator new(sizeof(BucketT)*NumBuckets)); // Initialize all the keys to EmptyKey. const KeyT EmptyKey = getEmptyKey(); @@ -387,7 +387,7 @@ private: } // Free the old table. - delete[] reinterpret_cast<char*>(OldBuckets); + operator delete(OldBuckets); NumEntries = 0; } |

