diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-01-14 00:38:21 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-01-14 00:38:21 +0000 |
commit | 07c2a78c2b9bf2500ece856c2df2dc043db9acb6 (patch) | |
tree | c731ee83c02c4746be4656deac52eeec755fa1a3 /include | |
parent | 92c6bd2c45f0002385300a8aa298fa34ef9bff64 (diff) | |
download | external_llvm-07c2a78c2b9bf2500ece856c2df2dc043db9acb6.zip external_llvm-07c2a78c2b9bf2500ece856c2df2dc043db9acb6.tar.gz external_llvm-07c2a78c2b9bf2500ece856c2df2dc043db9acb6.tar.bz2 |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Support/Allocator.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/Support/Allocator.h b/include/llvm/Support/Allocator.h index bc36535..b60ebca 100644 --- a/include/llvm/Support/Allocator.h +++ b/include/llvm/Support/Allocator.h @@ -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 {} |