libite
Macros | Functions
reallocarray.c File Reference
#include <sys/types.h>
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
Include dependency graph for reallocarray.c:

Macros

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

Functions

void * reallocarray (void *optr, size_t nmemb, size_t size)
 Similar to realloc() but for an array of items, like calloc() More...
 

Detailed Description

Author
Otto Moerbeek
Date
2008

Function Documentation

◆ reallocarray()

void* reallocarray ( void *  optr,
size_t  nmemb,
size_t  size 
)

Similar to realloc() but for an array of items, like calloc()

Parameters
optrPointer to old (current) array
nmembNumber of elements
sizeSize of each element, in bytes
Returns
A pointer to the new array, or NULL on error.