about summary refs log tree commit diff
path: root/src/base/tl/allocator.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/tl/allocator.hpp')
-rw-r--r--src/base/tl/allocator.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/base/tl/allocator.hpp b/src/base/tl/allocator.hpp
new file mode 100644
index 00000000..3baa1c19
--- /dev/null
+++ b/src/base/tl/allocator.hpp
@@ -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