37#define U_CALLOC_WITH_CAST(TYPE, SIZE) ((TYPE *)calloc(1, SIZE))
47#define U_TYPED_CALLOC(TYPE) ((TYPE *)calloc(1, sizeof(TYPE)))
58#define U_TYPED_ARRAY_CALLOC(TYPE, COUNT) ((TYPE *)calloc((COUNT), sizeof(TYPE)))
68#define U_ZERO(PTR) memset((PTR), 0, sizeof(*(PTR)))
78#define U_ZERO_ARRAY(ARRAY) memset((ARRAY), 0, sizeof(ARRAY))
91 void *ret = realloc(ptr, new_size);
92 if (ret == NULL && new_size != 0) {
117#define U_ARRAY_REALLOC_OR_FREE(VAR, TYPE, COUNT) (VAR) = ((TYPE *)u_realloc_or_free((VAR), sizeof(TYPE) * (COUNT)))
static void * u_realloc_or_free(void *ptr, size_t new_size)
Reallocates or frees dynamically-allocated memory.
Definition: u_misc.h:89