From a061009f52ffd636f3cd0cb142defde0b397572d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 15 May 2007 03:32:29 +0000 Subject: [PATCH] Make g_slice_debug_tree_statistics() debug-only functionality again. 2007-05-14 Matthias Clasen * 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 | 7 +++++++ docs/reference/ChangeLog | 5 +++++ docs/reference/glib/running.sgml | 17 ++++++++++++++++- glib/glib.symbols | 2 ++ glib/gslice.c | 4 ++-- glib/gslice.h | 1 - 6 files changed, 32 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index ff2f86d7a..55660f6d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-05-14 Matthias Clasen + + * glib/gslice.h: + * glib/gslice.c: + * glib/glib.symbols: Make g_slice_debug_tree_statistics() + debug-only functionality again. + 2007-05-14 Christian Persch * docs/reference/glib/tmpl/string_utils.sgml: Improve g_strerror and diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index 0799374c0..de10ddebe 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,8 @@ +2007-05-14 Matthias Clasen + + * glib/running.sgml: Document g_slice_debug_tree_statistics + as debug-only functionality. + 2007-05-11 Matthias Clasen * glib/tmpl/option.sgml: Document new G_OPTION_ARG_REMAINING diff --git a/docs/reference/glib/running.sgml b/docs/reference/glib/running.sgml index 8aae4f49f..a8952d2ee 100644 --- a/docs/reference/glib/running.sgml +++ b/docs/reference/glib/running.sgml @@ -255,6 +255,21 @@ is 20. - + +Memory statistics + +g_mem_profile() will output a summary g_malloc() memory usage, if memory +profiling has been enabled by calling +g_mem_set_vtable (glib_mem_profiler_table) upon startup. + + + +If GLib has been configured with , +then g_slice_debug_tree_statistics() can be called in a debugger to +output details about the memory usage of the slice allocator. + + + + diff --git a/glib/glib.symbols b/glib/glib.symbols index 71e7fa98e..45c238883 100644 --- a/glib/glib.symbols +++ b/glib/glib.symbols @@ -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__) diff --git a/glib/gslice.c b/glib/gslice.c index 1f87286f4..db0807047 100644 --- a/glib/gslice.c +++ b/glib/gslice.c @@ -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" diff --git a/glib/gslice.h b/glib/gslice.h index 43908418a..93b545a7c 100644 --- a/glib/gslice.h +++ b/glib/gslice.h @@ -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