Make memory management uniform: _everything_ now goes through the
[u/mdw/putty] / puttymem.h
1 /*
2 * PuTTY memory-handling header.
3 */
4
5 #ifndef PUTTY_PUTTYMEM_H
6 #define PUTTY_PUTTYMEM_H
7
8 /* #define MALLOC_LOG do this if you suspect putty of leaking memory */
9 #ifdef MALLOC_LOG
10 #define smalloc(z) (mlog(__FILE__,__LINE__), safemalloc(z))
11 #define srealloc(y,z) (mlog(__FILE__,__LINE__), saferealloc(y,z))
12 #define sfree(z) (mlog(__FILE__,__LINE__), safefree(z))
13 void mlog(char *, int);
14 #else
15 #define smalloc safemalloc
16 #define srealloc saferealloc
17 #define sfree safefree
18 #endif
19
20 void *safemalloc(size_t);
21 void *saferealloc(void *, size_t);
22 void safefree(void *);
23
24 #endif