diff options
| author | Paul Eggert | 2018-06-14 15:59:09 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-06-14 17:13:39 -0700 |
| commit | aca938d1f4ec176a2d00a77693b231298b9c5c4e (patch) | |
| tree | 7498947860bca4044afef608d1dc03e4717fde3d /src/lisp.h | |
| parent | 6c04c848e677e458e39811b10335cd6aeece6e2a (diff) | |
| download | emacs-aca938d1f4ec176a2d00a77693b231298b9c5c4e.tar.gz emacs-aca938d1f4ec176a2d00a77693b231298b9c5c4e.zip | |
Avoid allocating Lisp_Save_Value for excursions
* src/editfns.c (save_excursion_save): New arg PDL,
specifying where to save the state. All uses changed.
(save_excursion_restore): Args are now the marker and info
rather than a pointer to a Lisp_Save_Value containing them.
All uses changed.
* src/eval.c (default_toplevel_binding, Fbacktrace__locals):
Treat excursions like other miscellaneous pdl types.
(record_unwind_protect_excursion): Save data directly
into the pdl rather than creating an object on the heap.
This avoids the need to allocate and free an object.
(do_one_unbind, backtrace_eval_unrewind):
Unwind excursions directly.
(mark_specpdl): Mark excursions directly.
* src/lisp.h (SPECPDL_UNWIND_EXCURSION): New constant.
(union specbinding): New member unwind_excursion.
Diffstat (limited to 'src/lisp.h')
| -rw-r--r-- | src/lisp.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lisp.h b/src/lisp.h index b7e5d9e3761..af3f587222d 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3188,6 +3188,7 @@ enum specbind_tag { | |||
| 3188 | SPECPDL_UNWIND, /* An unwind_protect function on Lisp_Object. */ | 3188 | SPECPDL_UNWIND, /* An unwind_protect function on Lisp_Object. */ |
| 3189 | SPECPDL_UNWIND_PTR, /* Likewise, on void *. */ | 3189 | SPECPDL_UNWIND_PTR, /* Likewise, on void *. */ |
| 3190 | SPECPDL_UNWIND_INT, /* Likewise, on int. */ | 3190 | SPECPDL_UNWIND_INT, /* Likewise, on int. */ |
| 3191 | SPECPDL_UNWIND_EXCURSION, /* Likewise, on an execursion. */ | ||
| 3191 | SPECPDL_UNWIND_VOID, /* Likewise, with no arg. */ | 3192 | SPECPDL_UNWIND_VOID, /* Likewise, with no arg. */ |
| 3192 | SPECPDL_BACKTRACE, /* An element of the backtrace. */ | 3193 | SPECPDL_BACKTRACE, /* An element of the backtrace. */ |
| 3193 | SPECPDL_LET, /* A plain and simple dynamic let-binding. */ | 3194 | SPECPDL_LET, /* A plain and simple dynamic let-binding. */ |
| @@ -3216,6 +3217,10 @@ union specbinding | |||
| 3216 | } unwind_int; | 3217 | } unwind_int; |
| 3217 | struct { | 3218 | struct { |
| 3218 | ENUM_BF (specbind_tag) kind : CHAR_BIT; | 3219 | ENUM_BF (specbind_tag) kind : CHAR_BIT; |
| 3220 | Lisp_Object marker, window; | ||
| 3221 | } unwind_excursion; | ||
| 3222 | struct { | ||
| 3223 | ENUM_BF (specbind_tag) kind : CHAR_BIT; | ||
| 3219 | void (*func) (void); | 3224 | void (*func) (void); |
| 3220 | } unwind_void; | 3225 | } unwind_void; |
| 3221 | struct { | 3226 | struct { |
| @@ -4106,9 +4111,9 @@ extern void mark_threads (void); | |||
| 4106 | 4111 | ||
| 4107 | /* Defined in editfns.c. */ | 4112 | /* Defined in editfns.c. */ |
| 4108 | extern void insert1 (Lisp_Object); | 4113 | extern void insert1 (Lisp_Object); |
| 4109 | extern Lisp_Object save_excursion_save (void); | 4114 | extern void save_excursion_save (union specbinding *); |
| 4115 | extern void save_excursion_restore (Lisp_Object, Lisp_Object); | ||
| 4110 | extern Lisp_Object save_restriction_save (void); | 4116 | extern Lisp_Object save_restriction_save (void); |
| 4111 | extern void save_excursion_restore (Lisp_Object); | ||
| 4112 | extern void save_restriction_restore (Lisp_Object); | 4117 | extern void save_restriction_restore (Lisp_Object); |
| 4113 | extern _Noreturn void time_overflow (void); | 4118 | extern _Noreturn void time_overflow (void); |
| 4114 | extern Lisp_Object make_buffer_string (ptrdiff_t, ptrdiff_t, bool); | 4119 | extern Lisp_Object make_buffer_string (ptrdiff_t, ptrdiff_t, bool); |