Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No code is written to handle allocation failure because it knows that it's running on an OS with overcommit where handling allocation failure is impossible. Overcommit means that you encounter the problem not when you call `malloc()` but when you do `*pointer = value;`, which is impossible to handle.


Plenty of code runs on systems without that behavior. Graceful handling of malloc failure is still useful.


I know. I myself write code that checks the result of malloc. I was responding with josefx's words.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: