From: Ted Kremenek Date: Wed, 14 Jan 2009 00:38:21 +0000 (+0000) Subject: Add member template MallocAllocator::Allocate(Num) (to match the same function in... X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=07c2a78c2b9bf2500ece856c2df2dc043db9acb6;p=oota-llvm.git Add member template MallocAllocator::Allocate(Num) (to match the same function in BumpPtrAllocator). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62202 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/Allocator.h b/include/llvm/Support/Allocator.h index bc3653503ca..b60ebcaddf4 100644 --- a/include/llvm/Support/Allocator.h +++ b/include/llvm/Support/Allocator.h @@ -31,6 +31,11 @@ public: template T *Allocate() { return static_cast(malloc(sizeof(T))); } + template + T *Allocate(size_t Num) { + return static_cast(malloc(sizeof(T)*Num)); + } + void Deallocate(void *Ptr) { free(Ptr); } void PrintStats() const {}