检测错误码
This commit is contained in:
@@ -144,12 +144,17 @@ void *malloc(uint32_t size)
|
||||
{
|
||||
mallco_dev *self=&g_self;
|
||||
uint32_t offset;
|
||||
int used=0;
|
||||
void *ret_addr=NULL;
|
||||
offset=mem_malloc(size);
|
||||
if (offset!=0XFFFFFFFF)
|
||||
{
|
||||
ret_addr=(void*)((uint32_t)self->membase+offset);
|
||||
}
|
||||
else{
|
||||
used=mem_perused();
|
||||
param_check(used);
|
||||
}
|
||||
return ret_addr;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user