ddnet/src/base/tl/allocator.h
def 3be8a592e5 Run clang-format
Purely automatic change. In case of conflict with this change, apply the
other change and rerun the formatting to restore it:

$ python scripts/fix_style.py
2020-09-26 21:50:15 +02:00

18 lines
516 B
C++

/* (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