Comment by PhilipRoman

Comment by PhilipRoman 6 months ago

3 replies

>checking the return of any allocation call

I would say this is pointless on many modern systems unless you also disable overcommit, since otherwise any memory access can result in a crash, which is impossible to check for explicitly.

lionkor 6 months ago

Most code correctness is pointless until it isn't, yes

kevin_thibedeau 6 months ago

abort() isn't an option on all modern systems.

  • josephg 6 months ago

    It’s an option on most systems.

    Maybe not in embedded work - but in that case you might want to preallocate memory anyway.