1
0

mem_std.c 819 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. void *realloc(void *rmem, rt_size_t newsize)
  23. {
  24. return rt_realloc(rmem, newsize);
  25. }
  26. void *calloc(rt_size_t nelem, rt_size_t elsize)
  27. {
  28. return rt_calloc(nelem, elsize);
  29. }
  30. void free(void *rmem)
  31. {
  32. rt_free(rmem);
  33. }