Re: You still are in the "cleanup" mentality.
Re: You still are in the "cleanup" mentality.
Posted Dec 30, 2014 22:33 UTC (Tue) by cesarb (subscriber, #6266)In reply to: Re: You still are in the "cleanup" mentality. by ldo
Parent article: The "too small to fail" memory-allocation rule
> Returning NULL from an allocation request is a failure.
Please, reread the article this comment thread is attached to.
The whole issue is that, under certain conditions, the allocation requests were *never* returning NULL, even when they should!
> > Sure, you *called* the code unconditionally, but it doesn't change the fact that it *executes* conditionally.
> Do you know what “abstraction” means?
Please, reread the article this comment thread is attached to.
Abstraction or not, it doesn't change the fact that, since the allocation requests were *never* returning NULL, even when they should, the error handling code was *never* being executed. It doesn't matter whether it has been abstracted away or not, untested code is untested code.