[llvm-commits] [llvm] r62202 - /llvm/trunk/include/llvm/Support/Allocator.h
Ted Kremenek
kremenek at apple.com
Tue Jan 13 16:38:21 PST 2009
Author: kremenek
Date: Tue Jan 13 18:38:21 2009
New Revision: 62202
URL: http://llvm.org/viewvc/llvm-project?rev=62202&view=rev
Log:
Add member template MallocAllocator::Allocate(Num) (to match the same function in BumpPtrAllocator).
Modified:
llvm/trunk/include/llvm/Support/Allocator.h
Modified: llvm/trunk/include/llvm/Support/Allocator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Allocator.h?rev=62202&r1=62201&r2=62202&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Allocator.h (original)
+++ llvm/trunk/include/llvm/Support/Allocator.h Tue Jan 13 18:38:21 2009
@@ -31,6 +31,11 @@
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 {}
More information about the llvm-commits
mailing list