changeset 3313:509d2981ffea

[xemacs-hg @ 2006-03-28 17:43:43 by crestani] EMACS_INT -> double for gc_state, gc_state related clean up
author crestani
date Tue, 28 Mar 2006 17:43:54 +0000
parents b145b32294ff
children e775b8a2c635
files lisp/ChangeLog lisp/diagnose.el src/ChangeLog src/gc.c src/gc.h
diffstat 5 files changed, 37 insertions(+), 84 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Mar 28 15:55:52 2006 +0000
+++ b/lisp/ChangeLog	Tue Mar 28 17:43:54 2006 +0000
@@ -1,3 +1,9 @@
+2006-03-26  Marcus Crestani  <crestani@xemacs.org>
+
+	* diagnose.el (show-gc-stats): Adjust format string, remove
+	explicitly-freed statistics (the need to explicitly free went away
+	with the asynchronous finalization patch).
+
 2006-03-20  Malcolm Purvis  <malcolmp@xemacs.org>
 
 	* next-error.el: Rename functions that clash with the next-error
--- a/lisp/diagnose.el	Tue Mar 28 15:55:52 2006 +0000
+++ b/lisp/diagnose.el	Tue Mar 28 17:43:54 2006 +0000
@@ -398,10 +398,12 @@
   (interactive)
   (let ((buffer "*garbage collection statistics*")
 	(plist (gc-stats))
-	(fmt "%-9s %10s %10s %10s %10s %10s\n"))
+	(fmt "%-9s %16s %12s %12s %12s %12s\n"))
     (flet ((plist-get-stat (category field)
-	     (or (plist-get plist (intern (concat category field)))
-		 "-"))
+	     (let ((stat (plist-get plist (intern (concat category field)))))
+	       (if stat
+		   (format "%.0f" stat)
+		 "-")))
 	   (show-stats (category)
 	     (princ (format fmt category
 			    (plist-get-stat category "-total")
@@ -412,12 +414,12 @@
       (with-output-to-temp-buffer buffer
 	(save-excursion
 	  (set-buffer buffer)
-	  (princ (format "%s %s\n" "Current phase" (plist-get plist 'phase)))
-	  (princ (make-string 64 ?-))
+	  (princ (format "%s %g\n" "Current phase" (plist-get plist 'phase)))
+	  (princ (make-string 78 ?-))
 	  (princ "\n")
 	  (princ (format fmt "stat" "total" "last-gc" "this-gc" 
 			 "last-cycle" "this-cylce"))
-	  (princ (make-string 64 ?-))
+	  (princ (make-string 78 ?-))
 	  (princ "\n")
 	  (show-stats "n-gc")
 	  (show-stats "n-cycles")
@@ -428,13 +430,4 @@
 	  (show-stats "dequeued2")
 	  (show-stats "finalized")
 	  (show-stats "freed")
-	  (princ (make-string 64 ?-))
-	  (princ "\n")
-	  (princ (format fmt "explicitly"
-			 "freed:"
-			 (plist-get-stat "explicitly" "-freed")
-			 "tried:"
-			 (plist-get-stat "explicitly" "-tried-freed")
-			 "")))
-
-	(plist-get plist 'n-gc-total)))))
+	(plist-get plist 'n-gc-total))))))
--- a/src/ChangeLog	Tue Mar 28 15:55:52 2006 +0000
+++ b/src/ChangeLog	Tue Mar 28 17:43:54 2006 +0000
@@ -1,3 +1,15 @@
+2006-03-26  Marcus Crestani  <crestani@xemacs.org>
+
+	* gc.c: Remove functions for explicitly-freed statistics
+	(the need to explicitly free went away with the asynchronous
+	finalization patch).
+	* gc.c (struct gc_state): EMACS_INT -> double, remove
+	explicitly-freed statistics.
+	* gc.c (Fgc_stats): Remove explicitly-freed statistics.
+	* gc.c (PL): Use make_float.
+	* gc.h: Remove prototypes and macros for explicitly-freed
+	statistics.
+
 2006-03-24  Jerry James  <james@xemacs.org>
 
 	* alsaplay.c: New file providing support for sound with ALSA.
--- a/src/gc.c	Tue Mar 28 15:55:52 2006 +0000
+++ b/src/gc.c	Tue Mar 28 17:43:54 2006 +0000
@@ -125,17 +125,15 @@
 struct
 {
   enum gc_phase phase;
-  EMACS_INT n_gc[GC_STAT_COUNT];
-  EMACS_INT n_cycles[GC_STAT_COUNT];
-  EMACS_INT enqueued[GC_STAT_COUNT];
-  EMACS_INT dequeued[GC_STAT_COUNT];
-  EMACS_INT repushed[GC_STAT_COUNT];
-  EMACS_INT enqueued2[GC_STAT_COUNT];
-  EMACS_INT dequeued2[GC_STAT_COUNT];
-  EMACS_INT finalized[GC_STAT_COUNT];
-  EMACS_INT freed[GC_STAT_COUNT];
-  EMACS_INT explicitly_freed;
-  EMACS_INT explicitly_tried_freed;
+  double n_gc[GC_STAT_COUNT];
+  double n_cycles[GC_STAT_COUNT];
+  double enqueued[GC_STAT_COUNT];
+  double dequeued[GC_STAT_COUNT];
+  double repushed[GC_STAT_COUNT];
+  double enqueued2[GC_STAT_COUNT];
+  double dequeued2[GC_STAT_COUNT];
+  double finalized[GC_STAT_COUNT];
+  double freed[GC_STAT_COUNT];
 } gc_state;
 #endif /* ERROR_CHECK_GC */
 
@@ -226,54 +224,6 @@
   GC_STAT_TICK (freed);
 }
 
-void
-gc_stat_explicitly_freed (void)
-{
-  gc_state.explicitly_freed++;
-}
-
-void
-gc_stat_explicitly_tried_freed (void)
-{
-  gc_state.explicitly_tried_freed++;
-}
-
-#define GC_STAT_PRINT_ONE(stat)				\
-  printf (" | %9s %10d %10d %10d %10d %10d\n",		\
-	  #stat,					\
-	  (int) gc_state.stat[GC_STAT_TOTAL],		\
-	  (int) gc_state.stat[GC_STAT_IN_LAST_GC],	\
-	  (int) gc_state.stat[GC_STAT_IN_THIS_GC],	\
-	  (int) gc_state.stat[GC_STAT_IN_LAST_CYCLE],	\
-	  (int) gc_state.stat[GC_STAT_IN_THIS_CYCLE])
-
-void
-gc_stat_print_stats (void)
-{
-  printf (" | PHASE %d   TOTAL_GC %d\n",
-              (int) GC_PHASE,
-              (int) gc_state.n_gc[GC_STAT_TOTAL]);
-  printf (" | %9s %10s %10s %10s %10s %10s\n",
-	      "stat", "total", "last_gc", "this_gc",
-              "last_cycle", "this_cycle");
-  printf (" | %9s %10d %10d %10d \n",
-	      "cycle", (int) gc_state.n_cycles[GC_STAT_TOTAL],
-	      (int) gc_state.n_cycles[GC_STAT_IN_LAST_GC],
-	      (int) gc_state.n_cycles[GC_STAT_IN_THIS_GC]);
-
-  GC_STAT_PRINT_ONE (enqueued);
-  GC_STAT_PRINT_ONE (dequeued);
-  GC_STAT_PRINT_ONE (repushed);
-  GC_STAT_PRINT_ONE (enqueued2);
-  GC_STAT_PRINT_ONE (dequeued2);
-  GC_STAT_PRINT_ONE (finalized);
-  GC_STAT_PRINT_ONE (freed);
-
-  printf (" | explicitly freed %d   tried %d\n", 
-	  (int) gc_state.explicitly_freed, 
-	  (int) gc_state.explicitly_tried_freed);
-}
-
 DEFUN("gc-stats", Fgc_stats, 0, 0 ,"", /*
 Return statistics about garbage collection cycles in a property list.
 */
@@ -281,10 +231,8 @@
 {
   Lisp_Object pl = Qnil;
 #define PL(name,value) \
-  pl = cons3 (intern (name), make_int ((int) gc_state.value), pl)
+  pl = cons3 (intern (name), make_float (gc_state.value), pl)
 
-  PL ("explicitly-tried-freed", explicitly_tried_freed);
-  PL ("explicitly-freed", explicitly_freed);
   PL ("freed-in-this-cycle", freed[GC_STAT_IN_THIS_CYCLE]);
   PL ("freed-in-this-gc", freed[GC_STAT_IN_THIS_GC]);
   PL ("freed-in-last-cycle", freed[GC_STAT_IN_LAST_CYCLE]);
--- a/src/gc.h	Tue Mar 28 15:55:52 2006 +0000
+++ b/src/gc.h	Tue Mar 28 17:43:54 2006 +0000
@@ -34,17 +34,11 @@
 void gc_stat_print_stats (void);
 void gc_stat_finalized (void);
 void gc_stat_freed (void);
-void gc_stat_explicitly_freed (void);
-void gc_stat_explicitly_tried_freed (void);
 # define GC_STAT_FINALIZED gc_stat_finalized ()
 # define GC_STAT_FREED gc_stat_freed ()
-# define GC_STAT_EXPLICITLY_FREED gc_stat_explicitly_freed ()
-# define GC_STAT_EXPLICITLY_TRIED_FREED gc_stat_explicitly_tried_freed ()
 #else /* not ERROR_CHECK_GC */
 # define GC_STAT_FINALIZED
 # define GC_STAT_FREED
-# define GC_STAT_EXPLICITLY_FREED
-# define GC_STAT_EXPLICITLY_TRIED_FREED 
 #endif /* not ERROR_CHECK_GC */
 #endif /* not NEW_GC */