mirror of
https://github.com/CTCaer/hekate.git
synced 2025-04-20 11:35:56 +00:00
heap: Fix calloc memset size
This commit is contained in:
parent
58b57a7b14
commit
6d86516ffb
2 changed files with 2 additions and 2 deletions
|
@ -114,7 +114,7 @@ void *malloc(u32 size)
|
|||
void *calloc(u32 num, u32 size)
|
||||
{
|
||||
void *res = (void *)_heap_alloc(&_heap, num * size, sizeof(hnode_t));
|
||||
memset(res, 0, num * size);
|
||||
memset(res, 0, ALIGN(num * size, sizeof(hnode_t)));
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ void *malloc(u32 size)
|
|||
void *calloc(u32 num, u32 size)
|
||||
{
|
||||
void *res = (void *)_heap_alloc(&_heap, num * size, sizeof(hnode_t));
|
||||
memset(res, 0, num * size);
|
||||
memset(res, 0, ALIGN(num * size, sizeof(hnode_t)));
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue