Use mark_objects elsewhere too

* src/alloc.c (mark_vectorlike, mark_face_cache):
* src/eval.c (mark_specpdl):
* src/fringe.c (mark_fringe_data):
* src/keyboard.c (mark_kboards):
Use mark_objects instead of doing it by hand.
This commit is contained in:
Paul Eggert 2020-08-30 23:40:11 -07:00
parent 7e2f6f8448
commit 89350d4878
4 changed files with 8 additions and 19 deletions

View file

@ -6247,7 +6247,6 @@ mark_vectorlike (union vectorlike_header *header)
{
struct Lisp_Vector *ptr = (struct Lisp_Vector *) header;
ptrdiff_t size = ptr->header.size;
ptrdiff_t i;
eassert (!vector_marked_p (ptr));
@ -6262,8 +6261,7 @@ mark_vectorlike (union vectorlike_header *header)
the number of Lisp_Object fields that we should trace.
The distinction is used e.g. by Lisp_Process which places extra
non-Lisp_Object fields at the end of the structure... */
for (i = 0; i < size; i++) /* ...and then mark its elements. */
mark_object (ptr->contents[i]);
mark_objects (ptr->contents, size);
}
/* Like mark_vectorlike but optimized for char-tables (and
@ -6362,8 +6360,7 @@ mark_face_cache (struct face_cache *c)
{
if (c)
{
int i, j;
for (i = 0; i < c->used; ++i)
for (int i = 0; i < c->used; i++)
{
struct face *face = FACE_FROM_ID_OR_NULL (c->f, i);
@ -6372,8 +6369,7 @@ mark_face_cache (struct face_cache *c)
if (face->font && !vectorlike_marked_p (&face->font->header))
mark_vectorlike (&face->font->header);
for (j = 0; j < LFACE_VECTOR_SIZE; ++j)
mark_object (face->lface[j]);
mark_objects (face->lface, LFACE_VECTOR_SIZE);
}
}
}

View file

@ -3974,8 +3974,7 @@ mark_specpdl (union specbinding *first, union specbinding *ptr)
mark_object (backtrace_function (pdl));
if (nargs == UNEVALLED)
nargs = 1;
while (nargs--)
mark_object (backtrace_args (pdl)[nargs]);
mark_objects (backtrace_args (pdl), nargs);
}
break;

View file

@ -1733,11 +1733,7 @@ If nil, also continue lines which are exactly as wide as the window. */);
void
mark_fringe_data (void)
{
int i;
for (i = 0; i < max_fringe_bitmaps; i++)
if (!NILP (fringe_faces[i]))
mark_object (fringe_faces[i]);
mark_objects (fringe_faces, max_fringe_bitmaps);
}
/* Initialize this module when Emacs starts. */

View file

@ -12475,13 +12475,11 @@ keys_of_keyboard (void)
void
mark_kboards (void)
{
KBOARD *kb;
Lisp_Object *p;
for (kb = all_kboards; kb; kb = kb->next_kboard)
for (KBOARD *kb = all_kboards; kb; kb = kb->next_kboard)
{
if (kb->kbd_macro_buffer)
for (p = kb->kbd_macro_buffer; p < kb->kbd_macro_ptr; p++)
mark_object (*p);
mark_objects (kb->kbd_macro_buffer,
kb->kbd_macro_ptr - kb->kbd_macro_buffer);
mark_object (KVAR (kb, Voverriding_terminal_local_map));
mark_object (KVAR (kb, Vlast_command));
mark_object (KVAR (kb, Vreal_last_command));