From 0b3a5d14db268ca6e344df67e05be4543fbf4d5c Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 14 Mar 2003 18:31:47 +0000 Subject: [PATCH] - Slight reorganisation of functions that should be disabled Original commit message from CVS: - Slight reorganisation of functions that should be disabled - make sure _gst_debug_register_funcptr is #ifdeffed out when DEBUGGING is disabled. This should fix 106047. Please retest. --- gst/gstinfo.c | 31 +++++++++++++++---------------- gst/gstinfo.h | 12 +++--------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/gst/gstinfo.c b/gst/gstinfo.c index 07a26d139f..b2f478e916 100644 --- a/gst/gstinfo.c +++ b/gst/gstinfo.c @@ -484,13 +484,9 @@ gst_default_error_handler (gchar *file, gchar *function, } - /***** DEBUG system *****/ #ifdef GST_DEBUG_ENABLED -#ifdef GST_DEBUG_ENABLED GHashTable *__gst_function_pointers = NULL; -/* FIXME make this thread specific */ -/* static GSList *stack_trace = NULL; */ gchar *_gst_debug_nameof_funcptr (void *ptr) G_GNUC_NO_INSTRUMENT; @@ -507,12 +503,25 @@ _gst_debug_nameof_funcptr (void *ptr) return g_strdup_printf("%p",ptr); } return NULL; -#endif } -#endif + +void * +_gst_debug_register_funcptr (void *ptr, gchar *ptrname) +{ + if (!__gst_function_pointers) + __gst_function_pointers = g_hash_table_new (g_direct_hash, g_direct_equal); + if (!g_hash_table_lookup (__gst_function_pointers, ptr)) + g_hash_table_insert (__gst_function_pointers, ptr, ptrname); + + return ptr; +} +#endif /* GST_DEBUG_ENABLED */ #ifdef GST_ENABLE_FUNC_INSTRUMENTATION +/* FIXME make this thread specific */ +static GSList *stack_trace = NULL; + void __cyg_profile_func_enter(void *this_fn,void *call_site) G_GNUC_NO_INSTRUMENT; void __cyg_profile_func_enter(void *this_fn,void *call_site) { @@ -564,13 +573,3 @@ gst_debug_print_stack_trace (void) #endif /* GST_ENABLE_FUNC_INTSTRUMENTATION */ -void * -_gst_debug_register_funcptr (void *ptr, gchar *ptrname) -{ - if (!__gst_function_pointers) - __gst_function_pointers = g_hash_table_new (g_direct_hash, g_direct_equal); - if (!g_hash_table_lookup (__gst_function_pointers, ptr)) - g_hash_table_insert (__gst_function_pointers, ptr, ptrname); - return ptr; -} - diff --git a/gst/gstinfo.h b/gst/gstinfo.h index e860910c13..e7012d17a6 100644 --- a/gst/gstinfo.h +++ b/gst/gstinfo.h @@ -352,8 +352,6 @@ void gst_default_info_handler (gint category,gboolean incore, gint line,const gchar *debug_string, void *element,gchar *string); -void * _gst_debug_register_funcptr (void *ptr, gchar *ptrname); - extern GstInfoHandler _gst_info_handler; extern guint32 _gst_info_categories; @@ -458,13 +456,11 @@ extern GstErrorHandler _gst_error_handler; #endif - - - /********** function pointer stuff **********/ -extern GHashTable *__gst_function_pointers; - #if GST_DEBUG_ENABLED +void* _gst_debug_register_funcptr (void *ptr, gchar *ptrname); +gchar* _gst_debug_nameof_funcptr (void *ptr); + #define GST_DEBUG_FUNCPTR(ptr) _gst_debug_register_funcptr((void *)(ptr), #ptr) #define GST_DEBUG_FUNCPTR_NAME(ptr) _gst_debug_nameof_funcptr((void *)ptr) #else @@ -472,8 +468,6 @@ extern GHashTable *__gst_function_pointers; #define GST_DEBUG_FUNCPTR_NAME(ptr) "" #endif /* GST_DEBUG_ENABLED */ -gchar *_gst_debug_nameof_funcptr (void *ptr); - void gst_debug_print_stack_trace (void); #endif /* __GSTINFO_H__ */ -- 2.34.1