Embedded Artistry Framework
Embedded Systems C++ Framework
Macros | Functions
calloc.c File Reference
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for calloc.c:

Macros

#define MUL_NO_OVERFLOW   (1UL << (sizeof(size_t) * 4))
 

Functions

void * calloc (size_t num, size_t size)
 Allocates memory for an array of given number objects of size and initializes all bytes in the allocated storage to zero. More...
 

Macro Definition Documentation

◆ MUL_NO_OVERFLOW

#define MUL_NO_OVERFLOW   (1UL << (sizeof(size_t) * 4))

Function Documentation

◆ calloc()

void* calloc ( size_t  num,
size_t  size 
)

Allocates memory for an array of given number objects of size and initializes all bytes in the allocated storage to zero.

Allocates memory for an array of num objects of size size and initializes all bytes in the allocated storage to zero.

Parameters
numnumber of objects
sizesize of the array
Returns
(None)

References malloc(), memset(), MUL_NO_OVERFLOW, NULL, and SIZE_MAX.

Referenced by calloc_test(), and t_choose().

Here is the caller graph for this function: