diff --git a/bootloader/mem/heap.c b/bootloader/mem/heap.c index fd46c16..38ca7d2 100644 --- a/bootloader/mem/heap.c +++ b/bootloader/mem/heap.c @@ -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; } diff --git a/nyx/nyx_gui/mem/heap.c b/nyx/nyx_gui/mem/heap.c index 0c49de3..a56bef3 100644 --- a/nyx/nyx_gui/mem/heap.c +++ b/nyx/nyx_gui/mem/heap.c @@ -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; }