mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 23:13:40 +02:00
Remove unused ENABLE_GC_FRIENDLY_DEFAULT and its build option
ENABLE_GC_FRIENDLY_DEFAULT was supposed to set the default for the gc friendliness
while still allowing to force enable it at runtime with G_DEBUG=gc-friendly.
With commit 943a18b564
(6 years ago) things were changed to always set it
according to the content of G_DEBUG in glib_init(), making the default unused.
Since nobody complained since then just remove the macro and the build option.
This commit is contained in:
@@ -227,66 +227,6 @@
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><option>--disable-gc-friendly</option> and
|
||||
<option>--enable-gc-friendly</option></title>
|
||||
|
||||
<para>
|
||||
By default, and with <option>--disable-gc-friendly</option>
|
||||
as well, GLib does not clear the memory for certain objects before
|
||||
they are freed. For example, GLib may decide to recycle GList nodes
|
||||
by putting them in a free list. However, memory profiling and debugging
|
||||
tools like <ulink url="http://www.valgrind.org">Valgrind</ulink> work
|
||||
better if an application does not keep dangling pointers to freed
|
||||
memory (even though these pointers are no longer dereferenced), or
|
||||
invalid pointers inside uninitialized memory.
|
||||
The <option>--enable-gc-friendly</option> option makes GLib
|
||||
clear memory in these situations:
|
||||
</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
When shrinking a GArray, GLib will clear the memory no longer
|
||||
available in the array: shrink an array from 10 bytes to 7, and
|
||||
the last 3 bytes will be cleared. This includes removals of single
|
||||
and multiple elements.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
When growing a GArray, GLib will clear the new chunk of memory.
|
||||
Grow an array from 7 bytes to 10 bytes, and the last 3 bytes will
|
||||
be cleared.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The above applies to GPtrArray as well.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
When freeing a node from a GHashTable, GLib will first clear
|
||||
the node, which used to have pointers to the key and the value
|
||||
stored at that node.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
When destroying or removing a GTree node, GLib will clear the node,
|
||||
which used to have pointers to the node's value, and the left and
|
||||
right subnodes.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>
|
||||
Since clearing the memory has a cost,
|
||||
<option>--disable-gc-friendly</option> is the default.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><option>--disable-mem-pools</option> and
|
||||
<option>--enable-mem-pools</option></title>
|
||||
|
Reference in New Issue
Block a user