1 #ifndef DBMALLOC_H_
2 #define DBMALLOC_H_
3 
4 #include "stdint.h"
5 #include "stdlib.h"
6 #include "options.h"
7 
8 void * m_malloc(size_t size);
9 void * m_calloc(size_t nmemb, size_t size);
10 void * m_strdup(const char * str);
11 void * m_realloc(void* ptr, size_t size);
12 
13 #if DROPBEAR_TRACKING_MALLOC
14 void m_free_direct(void* ptr);
15 void m_malloc_set_epoch(unsigned int epoch);
16 void m_malloc_free_epoch(unsigned int epoch, int dofree);
17 
18 #else
19 /* plain wrapper */
20 #define m_free_direct free
21 
22 #endif
23 
24 #define m_free(X) do {m_free_direct(X); (X) = NULL;} while (0)
25 
26 
27 #endif /* DBMALLOC_H_ */
28