Add calloc to libc

This commit is contained in:
Ali Mashtizadeh 2023-08-19 22:14:06 -04:00
parent febc7b7997
commit e261ccdcec
2 changed files with 7 additions and 0 deletions

View File

@ -12,6 +12,7 @@ int atexit(void (*function)(void));
void exit(int status);
void abort(void);
void *calloc(size_t num, size_t sz);
void *malloc(size_t sz);
void free(void *buf);

View File

@ -150,6 +150,12 @@ free_large(Header *mem)
munmap(mem, mem->size);
}
void *
calloc(size_t num, size_t sz)
{
return malloc(num*sz);
}
void *
malloc(size_t sz)
{