diff options
author | Matt Johnston <matt@ucc.asn.au> | 2020-10-15 19:55:15 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2020-10-15 19:55:15 +0800 |
commit | 0e3e8db5bfca0c579be55e7580a46c593c1384be (patch) | |
tree | 2b1a718f633fb95c1f2d689a591cf9e8642697f3 /dbmalloc.h | |
parent | 78e17f6ee9a944430da3e517ee1fe384fd6b275b (diff) | |
parent | 17873e8c922eded2cec86184673a6d110df6403f (diff) |
merge from main
--HG--
branch : fuzz
Diffstat (limited to 'dbmalloc.h')
-rw-r--r-- | dbmalloc.h | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -1,16 +1,27 @@ #ifndef DBMALLOC_H_ #define DBMALLOC_H_ -#include "includes.h" +#include "stdint.h" +#include "stdlib.h" +#include "options.h" void * m_malloc(size_t size); void * m_calloc(size_t nmemb, size_t size); void * m_strdup(const char * str); void * m_realloc(void* ptr, size_t size); -void m_free_direct(void* ptr); -#define m_free(X) do {m_free_direct(X); (X) = NULL;} while (0) +#if DROPBEAR_TRACKING_MALLOC +void m_free_direct(void* ptr); void m_malloc_set_epoch(unsigned int epoch); void m_malloc_free_epoch(unsigned int epoch, int dofree); +#else +/* plain wrapper */ +#define m_free_direct free + +#endif + +#define m_free(X) do {m_free_direct(X); (X) = NULL;} while (0) + + #endif /* DBMALLOC_H_ */ |