added "fixed some header guards and added a script to fix them all!" by Choupom
[twcon.git] / src / base / tl / allocator.h
blobd12347e30683c68479d03d519038d8265029d51e
1 /* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2 /* If you are missing that file, acquire a complete release at teeworlds.com. */
3 #ifndef BASE_TL_ALLOCATOR_H
4 #define BASE_TL_ALLOCATOR_H
6 template <class T>
7 class allocator_default
9 public:
10 static T *alloc() { return new T; }
11 static void free(T *p) { delete p; }
13 static T *alloc_array(int size) { return new T [size]; }
14 static void free_array(T *p) { delete [] p; }
17 #endif // TL_FILE_ALLOCATOR_HPP