Преглед изворни кода

fix malloc(0xffffffff) issue.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1154 bbd45198-f89e-11dd-88c7-29a3b14d5316
bernard.xiong пре 15 година
родитељ
комит
b13215b7c7
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/slab.c

+ 1 - 1
src/slab.c

@@ -233,7 +233,7 @@ void *rt_page_alloc(rt_size_t npages)
 	struct rt_page_head *b, *n;
 	struct rt_page_head **prev;
 
-	RT_ASSERT(npages != 0);
+	if(npages == 0) return RT_NULL;
 
 	for (prev = &rt_page_list; (b = *prev) != RT_NULL; prev = &(b->next))
 	{