检测错误码

This commit is contained in:
ranchuan
2023-07-03 18:27:10 +08:00
parent 156d1ceeb4
commit 41c1e97ba5
9 changed files with 489 additions and 16 deletions

View File

@@ -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;
}