dbmalloc.h 571 B

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