From 32ffaf4c3251dd345ca8d28c3aa8b6ef3731e9e3 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Thu, 15 Dec 2005 02:23:15 +0000 Subject: [PATCH] added g_atomic_pointer_set() and g_atomic_int_set() Tue Dec 13 10:13:32 2005 Tim Janik * glib/gatomic.h: added g_atomic_pointer_set() and g_atomic_int_set() --- docs/reference/ChangeLog | 4 +++ docs/reference/glib/building.sgml | 59 +++++++++++++++++++++++++++---- 2 files changed, 57 insertions(+), 6 deletions(-) diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index 1318d7bb..2a4ed64d 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,7 @@ +2005-12-14 Federico Mena Quintero + + * glib/building.sgml: Clarify exactly what happens when you use --enable-gc-friendly. + Mon Dec 12 15:31:41 2005 Tim Janik * gobject/tmpl/objects.sgml: corrected floating reference documentation. diff --git a/docs/reference/glib/building.sgml b/docs/reference/glib/building.sgml index 93c9abfc..02d063d5 100644 --- a/docs/reference/glib/building.sgml +++ b/docs/reference/glib/building.sgml @@ -218,15 +218,62 @@ How to compile GLib itself --enable-gc-friendly - When enabled all memory freed by the application, - but retained by GLib for performance reasons - is set to zero, thus making deployed garbage - collection or memory profiling tools detect - unlinked memory correctly. This will make GLib - slightly slower and is thus disabled by default. + By default, and with --disable-gc-friendly + 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 Valgrind 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 + --enable-gc-friendly option makes Glib clear + memory in these situations: + + + + 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. + + + + + + + + + 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. + + + + + The above applies to GPtrArray as well. + + + + + 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. + + + + + 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. + + + + + + Since clearing the memory has a cost, + --disable-gc-friendly is the default. + + <systemitem>--disable-mem-pools</systemitem> and <systemitem>--enable-mem-pools</systemitem> -- 2.34.1