Next: , Previous: , Up: Failure   [Contents][Index]


12.4 Memory allocation failure

Failure to allocate memory is the most irrecoverable of irrecoverable errors. Even effective error handling assumes the ability to allocate memory, so that the practice has been, in the event of a memory allocation failure, to take Draconian action. On memory allocation failure, as with all irrecoverable failures, Libmarpa’s behavior in undefined, but Libmarpa attempts to terminate the current program abnormally by calling abort().

Memory allocation failure is the only case in which Libmarpa terminates the program. In all other cases, Libmarpa leaves the decision to terminate the program, whether normally or abnormally, up to the application programmer.

Memory allocation failure does not have an error code. As a pedantic matter, memory allocation failure is neither a hard or a soft failure.