Commit 785cd37f authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(mark_object): Save last 500 values of objptr.

Check for clobberage of ptr, when marking a vector.
parent 37bef230
......@@ -1269,6 +1269,10 @@ clear_marks ()
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 @@ mark_object (objptr)
&& (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,13 +1336,18 @@ mark_object (objptr)
{
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 */
{
if (ptr != ptr1)
abort ();
mark_object (&ptr->contents[i]);
}
}
break;
#ifdef MULTI_FRAME
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment