platform_memory.c 599 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * @Author: jiejie
  3. * @Github: https://github.com/jiejieTop
  4. * @Date: 2019-12-14 22:02:07
  5. * @LastEditTime: 2020-02-19 23:53:50
  6. * @Description: the code belongs to jiejie, please keep the author information and source code according to the license.
  7. */
  8. #include "platform_memory.h"
  9. #include "string.h"
  10. void *platform_memory_alloc(size_t size)
  11. {
  12. char *ptr;
  13. ptr = rt_malloc(size);
  14. memset(ptr, 0, size);
  15. return (void *)ptr;
  16. }
  17. void *platform_memory_calloc(size_t num, size_t size)
  18. {
  19. return rt_calloc(num, size);
  20. }
  21. void platform_memory_free(void *ptr)
  22. {
  23. rt_free(ptr);
  24. }