]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fgc_status): Print zombie list.
authorDave Love <fx@gnu.org>
Tue, 21 Jan 2003 16:56:38 +0000 (16:56 +0000)
committerDave Love <fx@gnu.org>
Tue, 21 Jan 2003 16:56:38 +0000 (16:56 +0000)
(mark_maybe_object) [GC_MARK_STACK==GC_USE_GCPROS_CHECK_ZOMBIES]:
Fix assignment of zombies.
(Fgarbage_collect) [GC_MARK_STACK==GC_USE_GCPROS_CHECK_ZOMBIES]:
Don't take car of non-cons.

src/ChangeLog
src/alloc.c

index 5303b23abd24664fdb931ecd9b7df83e426cd178..b08445ecd4669d97624bc6fa9c472ad92f424988 100644 (file)
@@ -1,3 +1,15 @@
+2003-01-21  Dave Love  <fx@gnu.org>
+
+       * alloc.c (Fgc_status): Print zombie list.
+       (mark_maybe_object) [GC_MARK_STACK==GC_USE_GCPROS_CHECK_ZOMBIES]:
+       Fix assignment of zombies.
+       (Fgarbage_collect) [GC_MARK_STACK==GC_USE_GCPROS_CHECK_ZOMBIES]:
+       Don't take car of non-cons.
+
+       * s/sol2-5.h (GC_SETJMP_WORKS, GC_MARK_STACK): Define.
+
+       * s/sunos4-0.h (GC_SETJMP_WORKS, GC_MARK_STACK): Define.
+
 2003-01-20  David Ponce  <david@dponce.com>
 
        * w32menu.c (digest_single_submenu): Declare all args.
index c61a0d9fa83bd0dc16b3ec7a5424850b99fbcdb6..10c4f6f235de148fb489b3fc486716526521772f 100644 (file)
@@ -3337,15 +3337,19 @@ DEFUN ("gc-status", Fgc_status, Sgc_status, 0, 0, "",
        doc: /* Show information about live and zombie objects.  */)
      ()
 {
-  Lisp_Object args[7];
-  args[0] = build_string ("%d GCs, avg live/zombies = %.2f/%.2f (%f%%), max %d/%d");
+  Lisp_Object args[8], zombie_list = Qnil;
+  int i;
+  for (i = 0; i < nzombies; i++)
+    zombie_list = Fcons (zombies[i], zombie_list);
+  args[0] = build_string ("%d GCs, avg live/zombies = %.2f/%.2f (%f%%), max %d/%d\nzombies: %S");
   args[1] = make_number (ngcs);
   args[2] = make_float (avg_live);
   args[3] = make_float (avg_zombies);
   args[4] = make_float (avg_zombies / avg_live / 100);
   args[5] = make_number (max_live);
   args[6] = make_number (max_zombies);
-  return Fmessage (7, args);
+  args[7] = zombie_list;
+  return Fmessage (8, args);
 }
 
 #endif /* GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES */
@@ -3427,7 +3431,7 @@ mark_maybe_object (obj)
        {
 #if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES
          if (nzombies < MAX_ZOMBIES)
-           zombies[nzombies] = *p;
+           zombies[nzombies] = obj;
          ++nzombies;
 #endif
          mark_object (&obj);
@@ -4342,7 +4346,8 @@ Garbage collection happens automatically if you cons more than
     double nlive = 0;
       
     for (i = 0; i < 7; ++i)
-      nlive += XFASTINT (XCAR (total[i]));
+      if (CONSP (total[i]))
+       nlive += XFASTINT (XCAR (total[i]));
 
     avg_live = (avg_live * ngcs + nlive) / (ngcs + 1);
     max_live = max (nlive, max_live);