aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorVibhav Pant2022-12-28 23:55:53 +0530
committerVibhav Pant2022-12-28 23:55:53 +0530
commit83c49e2f376c070e7448773e7add55b3a1e4a37e (patch)
treeab20744e141543d7602aa74c20b343d057926356 /src/alloc.c
parente7459fcbde4e468f9dfc74477072c7405b59e03e (diff)
downloademacs-83c49e2f376c070e7448773e7add55b3a1e4a37e.tar.gz
emacs-83c49e2f376c070e7448773e7add55b3a1e4a37e.zip
Avoid additional recursion while marking natively compiled unit.
* src/alloc.c (mark_native_comp_unit): Push psuedovector fields on the mark stack only, avoiding additional recursion.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 0a4323d1ceb..40f4402bca4 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -6821,9 +6821,16 @@ mark_char_table (struct Lisp_Vector *ptr, enum pvec_type pvectype)
6821} 6821}
6822 6822
6823static void 6823static void
6824mark_native_comp_unit (struct Lisp_Native_Comp_Unit *comp_u) 6824mark_stack_push_values (Lisp_Object *values, ptrdiff_t n);
6825
6826static void
6827mark_native_comp_unit (struct Lisp_Vector *ptr)
6825{ 6828{
6826 mark_vectorlike (&comp_u->header); 6829 struct Lisp_Native_Comp_Unit *comp_u
6830 = (struct Lisp_Native_Comp_Unit *) ptr;
6831 ptrdiff_t size = ptr->header.size & PSEUDOVECTOR_SIZE_MASK;
6832 set_vector_marked (ptr);
6833 mark_stack_push_values (ptr->contents, size);
6827 6834
6828#ifdef HAVE_STATIC_LISP_GLOBALS 6835#ifdef HAVE_STATIC_LISP_GLOBALS
6829 if (comp_u->have_static_lisp_data) 6836 if (comp_u->have_static_lisp_data)
@@ -6836,13 +6843,13 @@ mark_native_comp_unit (struct Lisp_Native_Comp_Unit *comp_u)
6836 6843
6837 Lisp_Object u_staticvec = comp_u->staticpro; 6844 Lisp_Object u_staticvec = comp_u->staticpro;
6838 if (!NILP (u_staticvec)) 6845 if (!NILP (u_staticvec))
6839 mark_objects (XVECTOR (u_staticvec)->contents, 6846 mark_stack_push_values (XVECTOR (u_staticvec)->contents,
6840 ASIZE (u_staticvec)); 6847 ASIZE (u_staticvec));
6841 6848
6842 Lisp_Object u_ephemeral = comp_u->ephemeral; 6849 Lisp_Object u_ephemeral = comp_u->ephemeral;
6843 if (!NILP (u_ephemeral)) 6850 if (!NILP (u_ephemeral))
6844 mark_objects (XVECTOR (u_ephemeral)->contents, 6851 mark_stack_push_values (XVECTOR (u_ephemeral)->contents,
6845 ASIZE (u_ephemeral)); 6852 ASIZE (u_ephemeral));
6846 } 6853 }
6847#endif 6854#endif
6848} 6855}
@@ -7288,7 +7295,7 @@ process_mark_stack (ptrdiff_t base_sp)
7288 break; 7295 break;
7289 7296
7290 case PVEC_NATIVE_COMP_UNIT: 7297 case PVEC_NATIVE_COMP_UNIT:
7291 mark_native_comp_unit (XNATIVE_COMP_UNIT (obj)); 7298 mark_native_comp_unit (ptr);
7292 break; 7299 break;
7293 7300
7294 case PVEC_FREE: 7301 case PVEC_FREE: