> Also, why would you bother to handle it gracefully when the OS won't allow you to do it?
There are many situations where you can get an allocation failure even with over provisioning enabled.
> Just don't use VLAs if then? "Problem" solved.
Yes, just don't use that language feature that is visually identical to a normal array. Then make sure that your standard library implementation doesn't have random malloc calls hidden in functions that cannot communicate an error and abort instead https://www.thingsquare.com/blog/articles/rand-may-call-mall.... Then ensure that your dependencies follow the same standards of handling allocation failures ... .
I concede that it might be possible, but you are working against an ecosystem that is actively trying to sabotage you.
There are many situations where you can get an allocation failure even with over provisioning enabled.
> Just don't use VLAs if then? "Problem" solved.
Yes, just don't use that language feature that is visually identical to a normal array. Then make sure that your standard library implementation doesn't have random malloc calls hidden in functions that cannot communicate an error and abort instead https://www.thingsquare.com/blog/articles/rand-may-call-mall.... Then ensure that your dependencies follow the same standards of handling allocation failures ... .
I concede that it might be possible, but you are working against an ecosystem that is actively trying to sabotage you.