|
|
|
|
|
by Manishearth
3741 days ago
|
|
A lot of folks are pointing out that malloc can fail, which is true, but the important part is that there are situations where your application will just abort randomly in the middle of nowhere (i.e. not during malloc) and there's nothing you can do about it. There are also situations where malloc fails and returns a null, but given the existence of situations with no errors on a malloc, handling the error in these cases isn't close to a solution. No language or stdlib can solve this problem 100%. At a baremetal level, it helps having this, but you're probably better off not using the stdlib anyway. |
|
> there are situations where your application will just abort randomly
That's sure as hell not the case in any environment I choose to use.