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
- question about code in send_selector Christopher T. Lansdown
- Re: question about code in send_selector Rink Springer
- Re: question about code in send_selector Christoph Reichenbach
- Re: question about code in send_selector Christopher T. Lansdown
- Re: question about code in send_selector Christoph Reichenbach
- Re: question about code in send_selector Rink Springer
- Re: question about code in send_selector Christoph Reichenbach
- Re: question about code in send_selector Rink Springer
- Re: question about code in send_selector Christopher T. Lansdown
- Re: question about code in send_selector Christoph Reichenbach
- Re: question about code in send_selector Christopher T. Lansdown
- Re: question about code in send_selector Christoph Reichenbach
- Re: question about code in send_selector Christopher T. Lansdown
- Re: question about code in send_selector Christoph Reichenbach
- RE: question about code in send_selector Dmitry Jemerov
- RE: question about code in send_selector Christoph Reichenbach
