#include <sys/types.h>
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
Go to the source code of this file.
- Author
- Otto Moerbeek
- Date
- 2008
- Copyright
- ISC License
Definition in file reallocarray.c.
◆ MUL_NO_OVERFLOW
#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4)) |
◆ reallocarray()
void * reallocarray |
( |
void * | optr, |
|
|
size_t | nmemb, |
|
|
size_t | size ) |
Similar to realloc() but for an array of items, like calloc()
- Parameters
-
optr | Pointer to old (current) array |
nmemb | Number of elements |
size | Size of each element, in bytes |
- Returns
- A pointer to the new array, or
NULL
on error.
Definition at line 44 of file reallocarray.c.