News for hackers. Stuff that matters.
Re:We do not use foreign keys (2016) by Litmus2336 on Friday November 08, 2019 @04:24PM (#21486965)
Seriously.

"As a C developer, I never check exit codes of child processes. We can just enforce it by ensuring child processes don't have bugs"

Re:We do not use foreign keys (2016) by benburleson on Friday November 08, 2019 @05:04PM (#21487347)
`malloc` won't fail, right?
Re:We do not use foreign keys (2016) by spookthesunset on Friday November 08, 2019 @05:16PM (#21487479)
the javascript will enforce the user input. no need to have the backend check it again!
Re:We do not use foreign keys (2016) by hnarn on Friday November 08, 2019 @05:48PM (#21487733)
This should be a joke, but considering how often it's actually the case it's unfortunately not that funny.
Re:We do not use foreign keys (2016) by ci5er on Friday November 08, 2019 @07:36PM (#21488542)
Not as much as developers who can't find their own coding errors might have you think!
Re:We do not use foreign keys (2016) by cryptonector on Friday November 08, 2019 @05:57PM (#21487795)
It won't on Linux! But hey, random processes will get OOM-killed.
Re:We do not use foreign keys (2016) by zenhack on Friday November 08, 2019 @11:39PM (#21489658)
You can turn off overcommit, in which case you'll get a null return instead of OOM killing.

But also, you can still get a malloc failure without actually be running out of memory if the allocator can't find a big enough contiguous chunk of address space.

This is highly unlikely on a 64 bit system, but if you try to malloc gigabytes on a 32 bit machine you might see it.

Re:We do not use foreign keys (2016) by Iv on Saturday November 09, 2019 @03:45AM (#21490415)
And also, you never know when this theoretical case actually happens but it did happen to me: at one point someone may use your code on an Arduino and unexpectedly, it works! But memory allocation could fail more than you expect!
Re:We do not use foreign keys (2016) by NullPrefix on Friday November 08, 2019 @05:57PM (#21487797)
On Unix it won't. You can overcommit memory and only get into trouble when you actually try to page it. But not at malloc time.
Re:We do not use foreign keys (2016) by patrickthebold on Friday November 08, 2019 @07:40PM (#21488564)
Iirc that's configurable.