未验证 提交 2be1cb42 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #4788 from yangjie11/memheap

[src] add RT_WEAK for rt_malloc_align,rt_free_align
...@@ -1238,7 +1238,7 @@ RTM_EXPORT(rt_kprintf); ...@@ -1238,7 +1238,7 @@ RTM_EXPORT(rt_kprintf);
* *
* @return the allocated memory block on successful, otherwise returns RT_NULL * @return the allocated memory block on successful, otherwise returns RT_NULL
*/ */
void *rt_malloc_align(rt_size_t size, rt_size_t align) RT_WEAK void *rt_malloc_align(rt_size_t size, rt_size_t align)
{ {
void *ptr; void *ptr;
void *align_ptr; void *align_ptr;
...@@ -1284,7 +1284,7 @@ RTM_EXPORT(rt_malloc_align); ...@@ -1284,7 +1284,7 @@ RTM_EXPORT(rt_malloc_align);
* *
* @param ptr the memory block pointer * @param ptr the memory block pointer
*/ */
void rt_free_align(void *ptr) RT_WEAK void rt_free_align(void *ptr)
{ {
void *real_ptr; void *real_ptr;
......
...@@ -757,6 +757,8 @@ static struct rt_memheap _heap; ...@@ -757,6 +757,8 @@ static struct rt_memheap _heap;
void rt_system_heap_init(void *begin_addr, void *end_addr) void rt_system_heap_init(void *begin_addr, void *end_addr)
{ {
RT_ASSERT((rt_uint32_t)end_addr > (rt_uint32_t)begin_addr);
/* initialize a default heap in the system */ /* initialize a default heap in the system */
rt_memheap_init(&_heap, rt_memheap_init(&_heap,
"heap", "heap",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册