docs: Add high-level documentation about malloc failure

While I’m here.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall 2023-04-28 11:01:01 +01:00
parent 3b9fc71644
commit e43b2452b9

View File

@ -19,6 +19,17 @@ General considerations when programming with GLib
<refsect1>
<title>Writing GLib Applications</title>
<refsect2>
<title>Memory Allocations</title>
<para>
Unless otherwise specified, all functions which allocate memory in GLib will
abort the process if heap allocation fails. This is because it is too hard to
recover from allocation failures in any non-trivial program and, in particular,
to test all the allocation failure code paths.
</para>
</refsect2>
<refsect2>
<title>Threads</title>