changeset 11403:bd3241a14d0a

(gc_sweep): If a misc has type Lisp_Misc_Free, keep it on the free list. Sum pseudovector sizes properly.
author Richard M. Stallman <rms@gnu.org>
date Wed, 12 Apr 1995 17:53:01 +0000
parents 66d935214d8e
children b12a8765508b
files src/alloc.c
diffstat 1 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/alloc.c	Wed Apr 12 06:16:00 1995 +0000
+++ b/src/alloc.c	Wed Apr 12 17:53:01 1995 +0000
@@ -2045,6 +2045,8 @@
     for (mblk = marker_block; mblk; mblk = mblk->next)
       {
 	register int i;
+	int already_free = -1;
+
 	for (i = 0; i < lim; i++)
 	  {
 	    Lisp_Object *markword;
@@ -2060,6 +2062,11 @@
 	      case Lisp_Misc_Overlay:
 		markword = &mblk->markers[i].u_overlay.plist;
 		break;
+	      case Lisp_Misc_Free:
+		/* If the object was already free, keep it
+		   on the free list.  */
+		markword = &already_free;
+		break;
 	      default:
 		markword = 0;
 		break;
@@ -2074,7 +2081,8 @@
 		    XSETMARKER (tem, tem1);
 		    unchain_marker (tem);
 		  }
-		/* We could leave the type alone, since nobody checks it,
+		/* Set the type of the freed object to Lisp_Misc_Free.
+		   We could leave the type alone, since nobody checks it,
 		   but this might catch bugs faster.  */
 		mblk->markers[i].u_marker.type = Lisp_Misc_Free;
 		mblk->markers[i].u_free.chain = marker_free_list;
@@ -2154,7 +2162,10 @@
       else
 	{
 	  vector->size &= ~ARRAY_MARK_FLAG;
-	  total_vector_size += vector->size;
+	  if (vector->size & PSEUDOVECTOR_FLAG)
+	    total_vector_size += (PSEUDOVECTOR_SIZE_MASK & vector->size);
+	  else
+	    total_vector_size += vector->size;
 	  prev = vector, vector = vector->next;
 	}
   }