2010-11-20 10:37:14 +00:00
|
|
|
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
|
|
|
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
2011-04-13 18:22:10 +00:00
|
|
|
#ifndef BASE_TL_ALLOCATOR_H
|
|
|
|
#define BASE_TL_ALLOCATOR_H
|
2009-06-15 06:45:44 +00:00
|
|
|
|
|
|
|
template <class T>
|
|
|
|
class allocator_default
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static T *alloc() { return new T; }
|
|
|
|
static void free(T *p) { delete p; }
|
|
|
|
|
|
|
|
static T *alloc_array(int size) { return new T [size]; }
|
|
|
|
static void free_array(T *p) { delete [] p; }
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TL_FILE_ALLOCATOR_HPP
|