+1 about a cheap check and common abort procedure for starters. I think figuring out what to do about cleanup and exception unwinding, and even what exception handling to use (if any) is a further platform-development issue that could be masked with simple still-inlineable code, but needs much more architectural thought.
-----Original Message----- From: jan i [mailto:[email protected]] Sent: Thursday, February 19, 2015 03:15 To: [email protected] Subject: Re: Checking malloc success and adding perror() [ ... ] I do agree that we should avoid exploding the code, however there are elegant solutions to that. I am a strong believer in "believe is good, control is better", meaning don“t trust such functions. Corinthia also works on small devices, and just think of someone opening a big complicated document on a smartphone...that is nearly bound to cause memory problems. Having the checks in code, makes us search for the problems in the right place....e.g. returning a NULL pointer might cause a crash in a very different place. [ ... ]
