From 17f12fc71a294ed00a1dd88093ec7ac516e0c15a Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 26 Jun 2015 22:36:31 +0200 Subject: Cycles: Allow using custom allocators for vector class --- intern/cycles/util/util_vector.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/intern/cycles/util/util_vector.h b/intern/cycles/util/util_vector.h index 92c3f116c69..af7c69c7df9 100644 --- a/intern/cycles/util/util_vector.h +++ b/intern/cycles/util/util_vector.h @@ -40,20 +40,16 @@ CCL_NAMESPACE_BEGIN * * - Have method to ensure capacity is re-set to 0. */ -template -class vector : public std::vector + typename allocator_type = GuardedAllocator +#else + typename allocator_type = std::allocator #endif - > + > +class vector : public std::vector { public: -#ifdef WITH_CYCLES_DEBUG - typedef GuardedAllocator allocator_type; -#else - typedef std::allocator allocator_type; -#endif - /* Default constructor. */ explicit vector() : std::vector() { } @@ -78,7 +74,8 @@ public: #endif } - void free_memory(void) { + void free_memory(void) + { std::vector::resize(0); shrink_to_fit(); } -- cgit v1.2.3