diff options
Diffstat (limited to 'src/base/tl/allocator.h')
| -rw-r--r-- | src/base/tl/allocator.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/base/tl/allocator.h b/src/base/tl/allocator.h new file mode 100644 index 00000000..3baa1c19 --- /dev/null +++ b/src/base/tl/allocator.h @@ -0,0 +1,15 @@ +#ifndef TL_FILE_ALLOCATOR_HPP +#define TL_FILE_ALLOCATOR_HPP + +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 |