#include "../include/alloc.h" #include #include void* mgui_alloc(size_t size) { void *mem = malloc(size); if(!mem) { fprintf(stderr, "mgui error: mgui_alloc failed to allocate %zu bytes\n", size); abort(); } return mem; } void* mgui_realloc(void *mem, size_t new_size) { void *new_mem = realloc(mem, new_size); if(!new_mem) { fprintf(stderr, "mgui error: mgui_realloc failed to reallocate %p to %zu bytes\n", mem, new_size); abort(); } return new_mem; } void mgui_free(void *mem) { free(mem); }