* @brief This function release the memory block, which is allocated by * rt_malloc_align function and address is aligned. * * @param ptr is the memory block pointer. */
| 1056 | * @param ptr is the memory block pointer. |
| 1057 | */ |
| 1058 | rt_weak void rt_free_align(void *ptr) |
| 1059 | { |
| 1060 | void *real_ptr = RT_NULL; |
| 1061 | |
| 1062 | /* NULL check */ |
| 1063 | if (ptr == RT_NULL) return; |
| 1064 | real_ptr = (void *) * (rt_uintptr_t *)((rt_uintptr_t)ptr - sizeof(void *)); |
| 1065 | rt_free(real_ptr); |
| 1066 | } |
| 1067 | RTM_EXPORT(rt_free_align); |
| 1068 | #endif /* RT_USING_HEAP */ |
| 1069 |