diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2009-06-15 06:45:44 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2009-06-15 06:45:44 +0000 |
| commit | 6309d7ad56357e3aecbfeb7096b434a03bdc70a8 (patch) | |
| tree | 1bf4e300ee2cd13e855c68a6e2160cbc98a06abb /src/base/tl/allocator.hpp | |
| parent | bc20e9c433c1c7bd2a9516a936d1d7ffee1e90f2 (diff) | |
| download | zcatch-6309d7ad56357e3aecbfeb7096b434a03bdc70a8.tar.gz zcatch-6309d7ad56357e3aecbfeb7096b434a03bdc70a8.zip | |
continued with localization
Diffstat (limited to 'src/base/tl/allocator.hpp')
| -rw-r--r-- | src/base/tl/allocator.hpp | 15 |
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 |