44 #include "avrmalloc.h" 48 #if MACRO_DOCUMENTATION 57 #define avr_new(type, count) \ 58 ((type *) avr_malloc ((unsigned) sizeof (type) * (count))) 67 #define avr_new0(type, count) \ 68 ((type *) avr_malloc0 ((unsigned) sizeof (type) * (count))) 78 #define avr_renew(type, mem, count) \ 79 ((type *) avr_realloc (mem, (unsigned) sizeof (type) * (count))) 122 ptr = calloc (1, size);
147 ptr = realloc (ptr, size);
void * avr_malloc0(size_t size)
Allocate memory and initialize to zero.
void avr_free(void *ptr)
Free malloc'd memory.
char * avr_strdup(const char *s)
Wrapper for strdup().
void * avr_realloc(void *ptr, size_t size)
Wrapper for realloc(). x Resizes and possibly allocates more memory for an existing memory block...
#define avr_error(fmt, args...)
Print an error message to stderr and terminate program.
void * avr_malloc(size_t size)
Allocate memory and initialize to zero.