提交 96c53b49 编写于 作者: B bernard.xiong

fix the magic issue in allocated memory block.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1344 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 baf5e414
......@@ -279,7 +279,6 @@ void *rt_malloc(rt_size_t size)
/* create mem2 struct */
mem2 = (struct heap_mem *)&heap_ptr[ptr2];
mem2->magic = HEAP_MAGIC;
mem2->used = 0;
mem2->next = mem->next;
mem2->prev = ptr;
......@@ -312,6 +311,8 @@ void *rt_malloc(rt_size_t size)
if (max_mem < used_mem) max_mem = used_mem;
#endif
}
/* set memory block magic */
mem->magic = HEAP_MAGIC;
if (mem == lfree)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册