XEmacs 21.2.20 "Yoko".
[chise/xemacs-chise.git-] / src / profile.c
index 6fa506b..648026f 100644 (file)
@@ -57,7 +57,7 @@ Boston, MA 02111-1307, USA.  */
    even be useful to provide a way to turn on only one profiling
    mechanism, but I haven't done so yet.  --hniksic */
 
-struct hash_table *big_profile_table;
+static struct hash_table *big_profile_table;
 Lisp_Object Vcall_count_profile_table;
 
 int default_profiling_interval;
@@ -68,10 +68,10 @@ int profiling_active;
    and is not set the whole time we're in redisplay. */
 int profiling_redisplay_flag;
 
-Lisp_Object QSin_redisplay;
-Lisp_Object QSin_garbage_collection;
-Lisp_Object QSprocessing_events_at_top_level;
-Lisp_Object QSunknown;
+static Lisp_Object QSin_redisplay;
+static Lisp_Object QSin_garbage_collection;
+static Lisp_Object QSprocessing_events_at_top_level;
+static Lisp_Object QSunknown;
 
 /* We use inside_profiling to prevent the handler from writing to
    the table while another routine is operating on it.  We also set
@@ -119,9 +119,9 @@ sigprof_handler (int signo)
        {
          fun = *backtrace_list->function;
 
-         if (!GC_SYMBOLP            (fun) &&
-             !GC_COMPILED_FUNCTIONP (fun) &&
-             !GC_SUBRP              (fun))
+         if (!SYMBOLP       (fun) &&
+             !COMPILED_FUNCTIONP (fun) &&
+             !SUBRP                 (fun))
             fun = QSunknown;
        }
       else
@@ -262,11 +262,6 @@ Return the profiling info as an alist.
   return closure.accum;
 }
 
-struct mark_profiling_info_closure
-{
-  void (*markfun) (Lisp_Object);
-};
-
 static int
 mark_profiling_info_maphash (CONST void *void_key,
                             void *void_val,
@@ -275,21 +270,18 @@ mark_profiling_info_maphash (CONST void *void_key,
   Lisp_Object key;
 
   CVOID_TO_LISP (key, void_key);
-  (((struct mark_profiling_info_closure *) void_closure)->markfun) (key);
+  mark_object (key);
   return 0;
 }
 
 void
-mark_profiling_info (void (*markfun) (Lisp_Object))
+mark_profiling_info (void)
 {
-  /* This function does not GC (if markfun doesn't) */
-  struct mark_profiling_info_closure closure;
-
-  closure.markfun = markfun;
+  /* This function does not GC */
   if (big_profile_table)
     {
       inside_profiling = 1;
-      maphash (mark_profiling_info_maphash, big_profile_table, &closure);
+      maphash (mark_profiling_info_maphash, big_profile_table, 0);
       inside_profiling = 0;
     }
 }