User: crestani
Date: 06/03/28 19:43:59
Modified: xemacs/src ChangeLog gc.c gc.h
Log:
EMACS_INT -> double for gc_state, gc_state related clean up
Revision Changes Path
1.731 +6 -0 XEmacs/xemacs/lisp/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/ChangeLog,v
retrieving revision 1.730
retrieving revision 1.731
diff -u -p -r1.730 -r1.731
--- ChangeLog 2006/03/25 11:20:50 1.730
+++ ChangeLog 2006/03/28 17:43:43 1.731
@@ -1,3 +1,9 @@
+2006-03-26 Marcus Crestani <crestani(a)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(a)xemacs.org>
* next-error.el: Rename functions that clash with the next-error
1.9 +9 -16 XEmacs/xemacs/lisp/diagnose.el
Index: diagnose.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/diagnose.el,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -r1.8 -r1.9
--- diagnose.el 2006/03/12 09:10:39 1.8
+++ diagnose.el 2006/03/28 17:43:45 1.9
@@ -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))))))
1.937 +12 -0 XEmacs/xemacs/src/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.936
retrieving revision 1.937
diff -u -p -r1.936 -r1.937
--- ChangeLog 2006/03/27 17:40:57 1.936
+++ ChangeLog 2006/03/28 17:43:52 1.937
@@ -1,3 +1,15 @@
+2006-03-26 Marcus Crestani <crestani(a)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(a)xemacs.org>
* alsaplay.c: New file providing support for sound with ALSA.
1.4 +10 -62 XEmacs/xemacs/src/gc.c
Index: gc.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gc.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- gc.c 2006/03/02 17:11:47 1.3
+++ gc.c 2006/03/28 17:43:53 1.4
@@ -125,17 +125,15 @@ enum gc_stat_id
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_freed (void)
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 @@ Return statistics about garbage collecti
{
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]);
1.3 +0 -6 XEmacs/xemacs/src/gc.h
Index: gc.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/gc.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- gc.h 2006/02/27 16:29:26 1.2
+++ gc.h 2006/03/28 17:43:54 1.3
@@ -34,17 +34,11 @@ BEGIN_C_DECLS
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 */