Add member template MallocAllocator::Allocate(Num) (to match the same function in...
authorTed Kremenek <kremenek@apple.com>
Wed, 14 Jan 2009 00:38:21 +0000 (00:38 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 14 Jan 2009 00:38:21 +0000 (00:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62202 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/Allocator.h

index bc3653503caf8715ccc7fce2f0f136e789151f84..b60ebcaddf472bc797b9f055de7e4f04fb993356 100644 (file)
@@ -31,6 +31,11 @@ public:
   template <typename T>
   T *Allocate() { return static_cast<T*>(malloc(sizeof(T))); }
   
+  template <typename T>
+  T *Allocate(size_t Num) { 
+    return static_cast<T*>(malloc(sizeof(T)*Num));
+  }
+  
   void Deallocate(void *Ptr) { free(Ptr); }
 
   void PrintStats() const {}