push
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "../../../kernel/include/memory/pmm.h"
|
||||
|
||||
void *calloc(size_t nmemb, size_t size) {
|
||||
if (nmemb == 0 || size == 0) return NULL;
|
||||
if (nmemb > (size_t)-1 / size) return NULL;
|
||||
void *ptr = kmalloc(nmemb * size);
|
||||
if (ptr) memset(ptr, 0, nmemb * size);
|
||||
return ptr;
|
||||
}
|
||||
Reference in New Issue
Block a user