malloc.h 764 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 <tchar.h>
  10. #include <stddef.h>
  11. #include <stdlib.h>
  12. #include "sd/defs.h"
  13. /**
  14. * @file malloc.h
  15. */
  16. __SD_BEGIN_DECLS
  17. typedef void (*sd_malloc_handler_t)();
  18. extern sd_malloc_handler_t sd_malloc_set_handler(void (*a_handler)());
  19. #ifndef __SD_DEBUG__
  20. extern void *sd_malloc(size_t n);
  21. extern void *sd_calloc(size_t n, size_t s);
  22. extern void *sd_realloc(void *p, size_t n);
  23. extern TCHAR *sd_strdup (const TCHAR *__str);
  24. #else
  25. #define sd_malloc malloc
  26. #define sd_calloc calloc
  27. #define sd_realloc realloc
  28. #define sd_strdup strdup
  29. #endif
  30. __SD_END_DECLS
  31. #endif