+ use in-place ::new/::delete
This commit is contained in:
parent
f0b6fffcc9
commit
2f5e7f8464
1 changed files with 3 additions and 3 deletions
4
deps/agg/include/agg_basics.h
vendored
4
deps/agg/include/agg_basics.h
vendored
|
@ -35,8 +35,8 @@ namespace agg
|
|||
//------------------------------------------------------------pod_allocator
|
||||
template<class T> struct pod_allocator
|
||||
{
|
||||
static T* allocate(unsigned num) { return new T [num]; }
|
||||
static void deallocate(T* ptr, unsigned) { 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) ;}
|
||||
};
|
||||
|
||||
// Single object allocator. It's also can be replaced with your custom
|
||||
|
|
Loading…
Reference in a new issue