about summary refs log tree commit diff
path: root/src/base/tl/allocator.h
blob: d12347e30683c68479d03d519038d8265029d51e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* (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.                */
#ifndef BASE_TL_ALLOCATOR_H
#define BASE_TL_ALLOCATOR_H

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