mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-11-29 18:48:09 +08:00
fix tk_alloc_impl for alloc failure
This commit is contained in:
parent
242cf6cff2
commit
b8366b06e8
@ -59,9 +59,12 @@ static void* tk_alloc_impl(uint32_t size) {
|
||||
|
||||
s_mem_stat.used_bytes += head->size;
|
||||
s_mem_stat.used_block_nr++;
|
||||
}
|
||||
|
||||
return (char*)ptr + sizeof(mem_block_t);
|
||||
return (char*)ptr + sizeof(mem_block_t);
|
||||
} else {
|
||||
log_warn("out of memory: size=%u\n", size);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void* tk_realloc_impl(void* ptr, uint32_t size) {
|
||||
|
Loading…
Reference in New Issue
Block a user