I agree with that... write a void* sci_malloc(unsigned long) function, that
calls deinits, prints a message and dies whenever the allocation fails.
Something like this (implementation):

void*
sci_malloc(unsigned long size) {
    void* ptr;

    if ((ptr=malloc(size))==NULL) {
        sci_deinit();
        printf("unable to allocate %lu bytes of memory\n",size);
        exit(100);
    }

    return ptr;
}

It's that simple... I suggest we use actual procedures instead of macros to
improve readability...

Rink

Reply via email to