Update.
[libtasn1.git] / lib / mem.h
blob267f62f311e287451b39a4497324fb89e7f50b92
1 #ifndef MEM_H
2 # define MEM_H
4 /* Use _asn1_afree() when calling alloca, or
5 * memory leaks may occur in systems which do not
6 * support alloca.
7 */
8 #ifdef HAVE_ALLOCA
9 # ifdef HAVE_ALLOCA_H
10 # include <alloca.h>
11 # endif
12 # define _asn1_alloca alloca
13 # define _asn1_afree(x)
14 #else
15 # define _asn1_alloca _asn1_malloc
16 # define _asn1_afree _asn1_free
17 #endif /* HAVE_ALLOCA */
19 #define _asn1_malloc malloc
20 #define _asn1_free free
21 #define _asn1_calloc calloc
22 #define _asn1_realloc realloc
23 #define _asn1_strdup strdup
25 #endif /* MEM_H */