Hacker News new | ask | show | jobs
by IshKebab 28 days ago
If a memory allocations fails with strict mode then you'll get a null pointer returns and some kind of crash or panic (in code that doesn't handle it properly).

If it fails with the default mode the whole process will get killed by the OS. Is that really much better?

1 comments

OOM is better. If a program doesn't handle ENOMEM properly, then its state is unpredictable and can lead to data corruption.
I don't think it's as simple as that. Killing a program can have unintended consequences too, e.g. corrupting files they were in the middle of writing.