Commit 58026347 authored by Kenichi Handa's avatar Kenichi Handa
Browse files

(mark_char_table): New function.

(mark_object): Use mark_char_table for a char-table.
parent af62aa88
......@@ -5371,6 +5371,34 @@ mark_vectorlike (ptr)
return 1;
}
/* Like mark_vectorlike but optimized for char-tables (and
sub-char-tables) assuming that the contents are mostly integers or
symbols. */
static void
mark_char_table (ptr)
struct Lisp_Vector *ptr;
{
register EMACS_INT size = ptr->size & PSEUDOVECTOR_SIZE_MASK;
register int i;
VECTOR_MARK (ptr);
for (i = 0; i < size; i++)
{
Lisp_Object val = ptr->contents[i];
if (INTEGERP (val) || SYMBOLP (val) && XSYMBOL (val)->gcmarkbit)
continue;
if (SUB_CHAR_TABLE_P (val))
{
if (! VECTOR_MARKED_P (XVECTOR (val)))
mark_char_table (XVECTOR (val));
}
else
mark_object (val);
}
}
void
mark_object (arg)
Lisp_Object arg;
......@@ -5533,6 +5561,11 @@ mark_object (arg)
VECTOR_MARK (XVECTOR (h->key_and_value));
}
}
else if (CHAR_TABLE_P (obj))
{
if (! VECTOR_MARKED_P (XVECTOR (obj)))
mark_char_table (XVECTOR (obj));
}
else
mark_vectorlike (XVECTOR (obj));
break;
......
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