small C-like programming language targeting the Uxn virtual computer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

18 lines
344 B

#include "umem.h"
void* UM_realloc(void *buf, size_t size) {
void *newBuf;
/* if the size is 0, just free it :) */
if (size == 0) {
free(buf);
return NULL;
}
if (!(newBuf = realloc(buf, size))) {
printf("Failed to reallocate memory!\n");
exit(EXIT_FAILURE);
}
return newBuf;
}