Make g_slice_debug_tree_statistics() debug-only functionality again.
authorMatthias Clasen <mclasen@redhat.com>
Tue, 15 May 2007 03:32:29 +0000 (03:32 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 15 May 2007 03:32:29 +0000 (03:32 +0000)
2007-05-14  Matthias Clasen  <mclasen@redhat.com>

        * glib/gslice.h:
        * glib/gslice.c:
        * glib/glib.symbols: Make g_slice_debug_tree_statistics()
        debug-only functionality again.

svn path=/trunk/; revision=5492

ChangeLog
docs/reference/ChangeLog
docs/reference/glib/running.sgml
glib/glib.symbols
glib/gslice.c
glib/gslice.h

index ff2f86d..55660f6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-05-14  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/gslice.h:
+       * glib/gslice.c:
+       * glib/glib.symbols: Make g_slice_debug_tree_statistics() 
+       debug-only functionality again.
+
 2007-05-14  Christian Persch  <chpe@gnome.org>
 
        * docs/reference/glib/tmpl/string_utils.sgml: Improve g_strerror and
index 0799374..de10dde 100644 (file)
@@ -1,3 +1,8 @@
+2007-05-14  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/running.sgml: Document g_slice_debug_tree_statistics
+       as debug-only functionality.
+
 2007-05-11  Matthias Clasen  <mclasen@redhat.com>
 
        * glib/tmpl/option.sgml: Document new G_OPTION_ARG_REMAINING
index 8aae4f4..a8952d2 100644 (file)
@@ -255,6 +255,21 @@ is 20.
 </para>
 </refsect2>
 
-</refsect1>
+<refsect2>
+<title>Memory statistics</title>
+
+<para>
+g_mem_profile() will output a summary g_malloc() memory usage, if memory
+profiling has been enabled by calling 
+<literal>g_mem_set_vtable (glib_mem_profiler_table)</literal> upon startup.
+</para>
 
+<para>
+If GLib has been configured with <option>--enable-debug=yes</option>,
+then g_slice_debug_tree_statistics() can be called in a debugger to 
+output details about the memory usage of the slice allocator.
+</para>
+
+</refsect2>
+</refsect1>
 </refentry>
index 71e7fa9..45c2388 100644 (file)
@@ -689,9 +689,11 @@ g_slice_free_chain_with_offset
 g_slice_set_config
 g_slice_get_config
 g_slice_get_config_state
+#ifdef INCLUDE_INTERNAL_SYMBOLS
 g_slice_debug_tree_statistics
 #endif
 #endif
+#endif
 
 #if IN_HEADER(__G_MESSAGES_H__)
 #if IN_FILE(__G_MESSAGES_C__)
index 1f87286..db08070 100644 (file)
@@ -1379,10 +1379,10 @@ smc_tree_remove (SmcKType key)
   return found_one;
 }
 
+#ifdef G_ENABLE_DEBUG
 void
 g_slice_debug_tree_statistics (void)
 {
-#ifdef  G_ENABLE_DEBUG
   g_mutex_lock (smc_tree_mutex);
   if (smc_tree_root)
     {
@@ -1438,8 +1438,8 @@ g_slice_debug_tree_statistics (void)
    * GSlice: MemChecker: 504.900474 branches per trunk, 98.81% utilization
    * GSlice: MemChecker: 4.965039 entries per branch, 1 minimum, 37 maximum
    */
-#endif /* G_ENABLE_DEBUG */
 }
+#endif /* G_ENABLE_DEBUG */
 
 #define __G_SLICE_C__
 #include "galiasdef.c"
index 4390841..93b545a 100644 (file)
@@ -71,7 +71,6 @@ typedef enum {
 void     g_slice_set_config       (GSliceConfig ckey, gint64 value);
 gint64   g_slice_get_config       (GSliceConfig ckey);
 gint64*  g_slice_get_config_state  (GSliceConfig ckey, gint64 address, guint *n_values);
-void     g_slice_debug_tree_statistics (void);
 
 G_END_DECLS