malloc.h 750 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* $Id$
  2. *
  3. * Copyright 2001-2003, Meiosys (www.meiosys.com). All rights reserved.
  4. *
  5. * See the COPYING file for the terms of usage and distribution.
  6. */
  7. #ifndef __sd_malloc_h
  8. #define __sd_malloc_h
  9. #include <stddef.h>
  10. #include <stdlib.h>
  11. #include <sd/defs.h>
  12. /**
  13. * @file malloc.h
  14. */
  15. __SD_BEGIN_DECLS
  16. typedef void (*sd_malloc_handler_t)();
  17. extern sd_malloc_handler_t sd_malloc_set_handler(void (*a_handler)());
  18. #ifndef __SD_DEBUG__
  19. extern void *sd_malloc(size_t n);
  20. extern void *sd_calloc(size_t n, size_t s);
  21. extern void *sd_realloc(void *p, size_t n);
  22. extern char *sd_strdup (const char *__str);
  23. #else
  24. #define sd_malloc malloc
  25. #define sd_calloc calloc
  26. #define sd_realloc realloc
  27. #define sd_strdup strdup
  28. #endif
  29. __SD_END_DECLS
  30. #endif