*** empty log message ***
[gnutls.git] / lib / gnutls_mem.h
blob1f501dbd7dfc3dccdacf89c017d5b7e32f01ed08
1 #ifndef GNUTLS_MEM_H
2 # define GNUTLS_MEM_H
4 #ifdef USE_DMALLOC
5 # include <dmalloc.h>
6 #endif
8 typedef void svoid; /* for functions that allocate using gnutls_secure_malloc */
10 /* Use gnutls_afree() when calling alloca, or
11 * memory leaks may occur in systems which do not
12 * support alloca.
14 #ifdef HAVE_ALLOCA
15 # define gnutls_alloca alloca
16 # define gnutls_afree(x)
17 #else
18 # define gnutls_alloca gnutls_malloc
19 # define gnutls_afree gnutls_free
20 #endif /* HAVE_ALLOCA */
22 extern void* (*gnutls_secure_malloc)(size_t);
23 extern void* (*gnutls_malloc)(size_t);
24 extern void (*gnutls_free)(void*);
25 extern int (*_gnutls_is_secure_memory)(const void*);
26 extern void* (*gnutls_realloc)(void*, size_t);
28 #define gnutls_realloc_fast(x, y) (y==0?x:realloc(x, y))
30 svoid* gnutls_secure_calloc( size_t nmemb, size_t size);
31 void* gnutls_calloc( size_t nmemb, size_t size);
33 char* gnutls_strdup( const char* s);
35 #endif /* GNUTLS_MEM_H */