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


14.4 Memory allocation failure

Failure to allocate memory is the most irrecoverable of irrecoverable errors. On memory allocation failure, as with all irrecoverable failures, Libmarpa’s behavior is undefined. Libmarpa attempts to terminate the current program abnormally by calling abort(), but a component of many modern operating systems is an out-of-memory (OOM) killer, which takes the decision out of the hands of both Libmarpa and the user. See Out-of-memory handling.

Memory allocation failure is the only case in which the decision to terminate the program is made for the user. 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.