提交 86e7b772 编写于 作者: B bernard.xiong@gmail.com

add object allocation check.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1258 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 2aeee86c
......@@ -16,6 +16,7 @@
* 2006-08-10 Bernard fix interrupt bug in rt_mp_alloc
* 2010-07-13 Bernard fix RT_ALIGN issue found by kuronca
* 2010-10-26 yi.qiu add module support in rt_mp_delete
* 2011-01-24 Bernard add object allocation check.
*/
#include <rthw.h>
......@@ -183,6 +184,7 @@ rt_mp_t rt_mp_create(const char* name, rt_size_t block_count, rt_size_t block_si
/* allocate object */
mp = (struct rt_mempool*)rt_object_allocate(RT_Object_Class_MemPool, name);
if (mp == RT_NULL) return RT_NULL; /* allocate object failed */
/* init memory pool */
mp->block_size = RT_ALIGN(block_size, RT_ALIGN_SIZE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册