News for hackers. Stuff that matters.
Re:Malloc Never Fails (2012) by foo101 on Tuesday June 11, 2019 @01:05AM (#20153127)
There is no guarantee offered by the standard that you must be able to read and write to memory allocated by malloc(). What if the memory was allocated and just a split second later, the physical RAM burnt out due to overheating? How is the standard supposed to guarantee reading and writing to it then?

Both the hardware burning after memory allocation and lack of availability of physical memory after memory allocation are outside the scope of the standard. The standard says nothing about them. A C program can fail in these scenarios without violating the standard.

There are no comments on this comment yet.