blob: 65e843350d4794bb8328a379121c81d4a7012ac9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
// SPDX-License-Identifier: GPL-2.0-only
#include <common.h>
#include <malloc.h>
/*
* calloc calls malloc, then zeroes out the allocated chunk.
*/
void *calloc(size_t n, size_t elem_size)
{
size_t size = elem_size * n;
void *r = malloc(size);
if (!r)
return r;
memset(r, 0x0, size);
return r;
}
EXPORT_SYMBOL(calloc);
|