From 8160485953e1439f4da28fac35b918822407436b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= Date: Wed, 1 Nov 2023 14:34:30 +0100 Subject: [PATCH] Non-recursive marking of buffer-local variables * src/alloc.c (mark_localized_symbol): Inline into... (process_mark_stack): ...this code and do don't use recursion. --- src/alloc.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index 45a950c4f81..cda8ba1ad46 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -6962,20 +6962,6 @@ mark_face_cache (struct face_cache *c) } } -NO_INLINE /* To reduce stack depth in mark_object. */ -static void -mark_localized_symbol (struct Lisp_Symbol *ptr) -{ - struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (ptr); - Lisp_Object where = blv->where; - /* If the value is set up for a killed buffer restore its global binding. */ - if ((BUFFERP (where) && !BUFFER_LIVE_P (XBUFFER (where)))) - swap_in_global_binding (ptr); - mark_object (blv->where); - mark_object (blv->valcell); - mark_object (blv->defcell); -} - /* Remove killed buffers or items whose car is a killed buffer from LIST, and mark other items. Return changed LIST, which is marked. */ @@ -7377,7 +7363,17 @@ process_mark_stack (ptrdiff_t base_sp) break; } case SYMBOL_LOCALIZED: - mark_localized_symbol (ptr); + { + struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (ptr); + Lisp_Object where = blv->where; + /* If the value is set up for a killed buffer, + restore its global binding. */ + if (BUFFERP (where) && !BUFFER_LIVE_P (XBUFFER (where))) + swap_in_global_binding (ptr); + mark_stack_push_value (blv->where); + mark_stack_push_value (blv->valcell); + mark_stack_push_value (blv->defcell); + } break; case SYMBOL_FORWARDED: /* If the value is forwarded to a buffer or keyboard field, -- 2.39.2