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!
This should be a joke, but considering how often it's actually the case it's unfortunately not that funny.
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.
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.
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.
"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"