News for hackers. Stuff that matters.
Re:A Story Of realloc (And Laziness) by fprawn on Sunday April 06, 2014 @08:11PM (#7543881)
If you have time, can you expound on this? Is there, perhaps, an open source project that handles NULL returns from malloc in this way you could point me to?
Re:A Story Of realloc (And Laziness) by asveikau on Sunday April 06, 2014 @08:32PM (#7543953)
My first instinct is to say look at something kernel-related. If an allocation fails, taking down the entire system is usually not an option (or not a good one anyway). Searching http://lxr.linux.no/ for "kmalloc" you see a lot of callers handling failure.
Re:A Story Of realloc (And Laziness) by asveikau on Monday April 07, 2014 @12:12PM (#7547342)
Adding a bit more after the fact: most well-written libraries in C are also like this. It's not a library's business to decide to exit the process at any time. The library doesn't know if it's some long-running process that absolutely must keep going, for example.