[gimp] app: get rid of gimp_get_backtrace().



commit 33a92e24473bcb60aea3920826fc82406a0de5eb
Author: Jehan <jehan girinstud io>
Date:   Sat May 5 20:18:25 2018 +0200

    app: get rid of gimp_get_backtrace().
    
    It is not used anywhere anymore and can be replaced by the more powerful
    gimp_stack_trace_print() (which can also allocate a string containing
    the backtrace, hence is a proper replacement call).

 app/core/gimp-utils.c |   37 -------------------------------------
 app/core/gimp-utils.h |    1 -
 2 files changed, 0 insertions(+), 38 deletions(-)
---
diff --git a/app/core/gimp-utils.c b/app/core/gimp-utils.c
index 9f3daf0..321e522 100644
--- a/app/core/gimp-utils.c
+++ b/app/core/gimp-utils.c
@@ -103,43 +103,6 @@ gimp_get_physical_memory_size (void)
   return 0;
 }
 
-/**
- * gimp_get_backtrace:
- *
- * Returns: The current stack trace. Free with g_free(). Mainly meant
- * for debugging, for example storing the allocation stack traces for
- * objects to hunt down leaks.
- **/
-gchar *
-gimp_get_backtrace (void)
-{
-#if defined(G_OS_UNIX) && defined(HAVE_EXECINFO_H)
-  void     *functions[MAX_FUNC];
-  char    **function_names;
-  int       n_functions;
-  int       i;
-  GString  *result;
-
-  /* Get symbols */
-  n_functions    = backtrace (functions, MAX_FUNC);
-  function_names = backtrace_symbols (functions, n_functions);
-
-  /* Construct stack trace */
-  result = g_string_new ("");
-  for (i = 0; i < n_functions; i++)
-    g_string_append_printf (result, "%s\n", function_names[i]);
-
-  /* We must not free the function names themselves, we only need to
-   * free the array that points to them
-   */
-  free (function_names);
-
-  return g_string_free (result, FALSE/*free_segment*/);
-#else
-  return g_strdup ("backtrace() only available with GNU libc\n");
-#endif
-}
-
 /*
  *  basically copied from gtk_get_default_language()
  */
diff --git a/app/core/gimp-utils.h b/app/core/gimp-utils.h
index ec5f604..2e9e275 100644
--- a/app/core/gimp-utils.h
+++ b/app/core/gimp-utils.h
@@ -34,7 +34,6 @@
 
 gint         gimp_get_pid                          (void);
 guint64      gimp_get_physical_memory_size         (void);
-gchar      * gimp_get_backtrace                    (void);
 gchar      * gimp_get_default_language             (const gchar     *category);
 GimpUnit     gimp_get_default_unit                 (void);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]