libite 2.6.1
reallocarray.c File Reference
#include <sys/types.h>
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>

Go to the source code of this file.

Macros

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

Functions

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

Detailed Description

Author
Otto Moerbeek
Date
2008

Definition in file reallocarray.c.

Macro Definition Documentation

◆ MUL_NO_OVERFLOW

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

Definition at line 34 of file reallocarray.c.

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.

Definition at line 44 of file reallocarray.c.