(no title) (original) (raw)
Hi, new-ish person here..
I have a problem with malloc...
I use this macro for when allocating memory
#define CREATE(result, type, number)
do
{
if (!((result) = (type *) calloc ((number), sizeof(type))))
{
perror("malloc");
fprintf(stderr, "Malloc failure @ %s:%d\n", FILE, LINE );
abort();
}
} while(0)
But it tends to crash once in a while.
I don't think its an issue with memory space, but it might be
Wondering if i should try something else, or even move to C++ classes and thus the newer memory management