2017-05-21 02:54:11 +00:00
|
|
|
#ifndef DBMALLOC_H_
|
|
|
|
#define DBMALLOC_H_
|
|
|
|
|
2018-03-01 16:02:06 +00:00
|
|
|
#include "options.h"
|
2021-03-04 13:03:02 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdlib.h>
|
2017-05-21 02:54:11 +00:00
|
|
|
|
|
|
|
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);
|
2018-03-01 15:46:24 +00:00
|
|
|
|
|
|
|
#if DROPBEAR_TRACKING_MALLOC
|
2017-05-21 02:54:11 +00:00
|
|
|
void m_free_direct(void* ptr);
|
|
|
|
void m_malloc_set_epoch(unsigned int epoch);
|
2017-05-25 16:19:39 +00:00
|
|
|
void m_malloc_free_epoch(unsigned int epoch, int dofree);
|
2017-05-21 02:54:11 +00:00
|
|
|
|
2018-03-01 15:46:24 +00:00
|
|
|
#else
|
|
|
|
/* plain wrapper */
|
2018-03-01 16:02:06 +00:00
|
|
|
#define m_free_direct free
|
2018-03-01 15:46:24 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2018-03-01 16:02:06 +00:00
|
|
|
#define m_free(X) do {m_free_direct(X); (X) = NULL;} while (0)
|
|
|
|
|
2018-03-01 15:46:24 +00:00
|
|
|
|
2017-05-21 02:54:11 +00:00
|
|
|
#endif /* DBMALLOC_H_ */
|