mem_std.c 901 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * File : mem_std.c
  3. * Brief : implement standard memory routins.
  4. *
  5. * This file is part of Device File System in RT-Thread RTOS
  6. * COPYRIGHT (C) 2014, RT-Thread Development Team
  7. *
  8. * The license and distribution terms for this file may be
  9. * found in the file LICENSE in this distribution or at
  10. * http://www.rt-thread.org/license/LICENSE.
  11. *
  12. * Change Logs:
  13. * 2014-08-03 bernard Add file header.
  14. */
  15. #include "rtthread.h"
  16. /* avoid the heap and heap-using library functions supplied by arm */
  17. #pragma import(__use_no_heap)
  18. void *malloc(int n)
  19. {
  20. return rt_malloc(n);
  21. }
  22. RTM_EXPORT(malloc);
  23. void *realloc(void *rmem, rt_size_t newsize)
  24. {
  25. return rt_realloc(rmem, newsize);
  26. }
  27. RTM_EXPORT(realloc);
  28. void *calloc(rt_size_t nelem, rt_size_t elsize)
  29. {
  30. return rt_calloc(nelem, elsize);
  31. }
  32. RTM_EXPORT(calloc);
  33. void free(void *rmem)
  34. {
  35. rt_free(rmem);
  36. }
  37. RTM_EXPORT(free);