+ restore allocator (as it used to store objects with

non-trivial ctor's - svg_converter) TODO: expose allocator
This commit is contained in:
Artem Pavlenko 2012-05-15 14:30:04 +01:00
parent 9c9753d2c8
commit 92c41e8626

View file

@ -35,8 +35,10 @@ namespace agg
//------------------------------------------------------------pod_allocator
template<class T> struct pod_allocator
{
static T* allocate(unsigned num) { return static_cast<T*>(::operator new(sizeof(T)*num));}
static void deallocate(T* ptr, unsigned) { ::operator delete(ptr) ;}
//static T* allocate(unsigned num) { return static_cast<T*>(::operator new(sizeof(T)*num));}
//static void deallocate(T* ptr, unsigned) { ::operator delete(ptr) ;}
static T* allocate(unsigned num) { return new T [num]; }
static void deallocate(T* ptr, unsigned) { delete [] ptr; }
};
// Single object allocator. It's also can be replaced with your custom