48 void *
mycalloc(
const char *file,
int line,
unsigned long size,
51 void *ptr = calloc(size, typesize);
55 fprintf(stderr,
"[GenSVM Error]: Couldn't allocate memory: " 56 "%lu bytes (%s:%d)\n", size, file, line);
81 void *
mymalloc(
const char *file,
int line,
unsigned long size)
83 void *ptr = malloc(size);
86 fprintf(stderr,
"[GenSVM Error]: Couldn't allocate memory: " 87 "%lu bytes (%s:%d)\n", size, file, line);
113 void *
myrealloc(
const char *file,
int line,
unsigned long size,
void *var)
115 void *ptr = realloc(var, size);
118 fprintf(stderr,
"[GenSVM Error]: Couldn't reallocate memory: " 119 "%lu bytes (%s:%d)\n", size, file, line);
void * mymalloc(const char *file, int line, unsigned long size)
Wrapper for malloc() which warns when allocation fails.
void * myrealloc(const char *file, int line, unsigned long size, void *var)
Wrapper for realloc() which warns when allocation fails.
void * mycalloc(const char *file, int line, unsigned long size, size_t typesize)
Wrapper for calloc() which warns when allocation fails.