summaryrefslogtreecommitdiff
path: root/Utils/allocator.h
blob: 8b0fdb6e7591975558b39ccf12b5a4339699a1ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#ifndef __ALLOCATOR_H__
#define __ALLOCATOR_H__

#include <stdlib.h>

template<class T>
class Allocator {
  public:
    static T * alloc(int n) { return (T*) calloc(n, sizeof(T)); };
    static void free(T * & ptr) { free(ptr); ptr = 0; }
};

#endif