changeset 1168:2b07af77d7ec

(mark_object): Save last 500 values of objptr. Check for clobberage of ptr, when marking a vector.
author Richard M. Stallman <rms@gnu.org>
date Sat, 19 Sep 1992 17:52:29 +0000
parents a9aeeaa9da8f
children a40b54fcb2ff
files src/alloc.c
diffstat 1 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/alloc.c	Sat Sep 19 17:52:07 1992 +0000
+++ b/src/alloc.c	Sat Sep 19 17:52:29 1992 +0000
@@ -1269,6 +1269,10 @@
    lives in the last slot in the chain.  We recognize the end
    because it is < (unsigned) STRING_BLOCK_SIZE.  */
 
+#define LAST_MARKED_SIZE 500
+Lisp_Object *last_marked[LAST_MARKED_SIZE];
+int last_marked_index;
+
 static void
 mark_object (objptr)
      Lisp_Object *objptr;
@@ -1284,6 +1288,10 @@
       && (PNTR_COMPARISON_TYPE) XPNTR (obj) >= (PNTR_COMPARISON_TYPE) pure)
     return;
 
+  last_marked[last_marked_index++] = objptr;
+  if (last_marked_index == LAST_MARKED_SIZE)
+    last_marked_index = 0;
+
 #ifdef SWITCH_ENUM_BUG
   switch ((int) XGCTYPE (obj))
 #else
@@ -1328,12 +1336,17 @@
       {
 	register struct Lisp_Vector *ptr = XVECTOR (obj);
 	register int size = ptr->size;
+	struct Lisp_Vector *volatile ptr1 = ptr;
 	register int i;
 
 	if (size & ARRAY_MARK_FLAG) break;   /* Already marked */
 	ptr->size |= ARRAY_MARK_FLAG; /* Else mark it */
 	for (i = 0; i < size; i++)     /* and then mark its elements */
-	  mark_object (&ptr->contents[i]);
+	  {
+	    if (ptr != ptr1)
+	      abort ();
+	    mark_object (&ptr->contents[i]);
+	  }
       }
       break;