aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPaul Eggert2018-06-07 19:12:28 -0700
committerPaul Eggert2018-06-14 17:13:39 -0700
commitd98670eb04925fdc4a4928a9b0d0858881da418f (patch)
tree52d74dac7f568f7bcfe252ec9efd7658177895e0 /src/alloc.c
parentaca938d1f4ec176a2d00a77693b231298b9c5c4e (diff)
downloademacs-d98670eb04925fdc4a4928a9b0d0858881da418f.tar.gz
emacs-d98670eb04925fdc4a4928a9b0d0858881da418f.zip
Avoid allocating Lisp_Save_Value for arrays
* src/alloc.c (mark_maybe_objects): New function. * src/eval.c (default_toplevel_binding) (backtrace_eval_unrewind, Fbacktrace__locals): Treat array unwindings like other miscellaneous pdl types. (record_unwind_protect_array): New function. (do_one_unbind): Free the array while unwinding. (mark_specpdl): Mark arrays directly. * src/lisp.h (SPECPDL_UNWIND_ARRAY): New constant. (union specbinding): New member unwind_array. (SAFE_ALLOCA_LISP_EXTRA): Use record_unwind_protect_array instead of make_save_memory + record_unwind_protect.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c
index e5fc6ebeb1a..1d3ec4fbb8a 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -4845,6 +4845,13 @@ mark_maybe_object (Lisp_Object obj)
4845 } 4845 }
4846} 4846}
4847 4847
4848void
4849mark_maybe_objects (Lisp_Object *array, ptrdiff_t nelts)
4850{
4851 for (Lisp_Object *lim = array + nelts; array < lim; array++)
4852 mark_maybe_object (*array);
4853}
4854
4848/* Return true if P might point to Lisp data that can be garbage 4855/* Return true if P might point to Lisp data that can be garbage
4849 collected, and false otherwise (i.e., false if it is easy to see 4856 collected, and false otherwise (i.e., false if it is easy to see
4850 that P cannot point to Lisp data that can be garbage collected). 4857 that P cannot point to Lisp data that can be garbage collected).