Index: src/core/SkSmallAllocator.h |
diff --git a/src/core/SkSmallAllocator.h b/src/core/SkSmallAllocator.h |
index 8d4b53a707d9db9c56fa3eaa16fb1b6ca7b7ae85..018705f974f1f472dd6fe38e631e4d6f3ab358f1 100644 |
--- a/src/core/SkSmallAllocator.h |
+++ b/src/core/SkSmallAllocator.h |
@@ -96,6 +96,16 @@ public: |
return static_cast<T*>(buf); |
} |
+ template<typename T, typename A1, typename A2, typename A3, typename A4> |
+ T* createT(const A1& a1, const A2& a2, const A3& a3, const A4& a4) { |
+ void* buf = this->reserveT<T>(); |
+ if (NULL == buf) { |
+ return NULL; |
+ } |
+ SkNEW_PLACEMENT_ARGS(buf, T, (a1, a2, a3, a4)); |
+ return static_cast<T*>(buf); |
+ } |
+ |
/* |
* Reserve a specified amount of space (must be enough space for one T). |
* The space will be in fStorage if there is room, or on the heap otherwise. |