diff options
Diffstat (limited to 'src/lisp.h')
| -rw-r--r-- | src/lisp.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/lisp.h b/src/lisp.h index 778bd1bfa5a..b99441fa6c1 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3454,6 +3454,41 @@ backtrace_debug_on_exit (union specbinding *pdl) | |||
| 3454 | return pdl->bt.debug_on_exit; | 3454 | return pdl->bt.debug_on_exit; |
| 3455 | } | 3455 | } |
| 3456 | 3456 | ||
| 3457 | void grow_specpdl_allocation (void); | ||
| 3458 | |||
| 3459 | /* Grow the specpdl stack by one entry. | ||
| 3460 | The caller should have already initialized the entry. | ||
| 3461 | Signal an error on stack overflow. | ||
| 3462 | |||
| 3463 | Make sure that there is always one unused entry past the top of the | ||
| 3464 | stack, so that the just-initialized entry is safely unwound if | ||
| 3465 | memory exhausted and an error is signaled here. Also, allocate a | ||
| 3466 | never-used entry just before the bottom of the stack; sometimes its | ||
| 3467 | address is taken. */ | ||
| 3468 | INLINE void | ||
| 3469 | grow_specpdl (void) | ||
| 3470 | { | ||
| 3471 | specpdl_ptr++; | ||
| 3472 | if (specpdl_ptr == specpdl + specpdl_size) | ||
| 3473 | grow_specpdl_allocation (); | ||
| 3474 | } | ||
| 3475 | |||
| 3476 | INLINE specpdl_ref | ||
| 3477 | record_in_backtrace (Lisp_Object function, Lisp_Object *args, ptrdiff_t nargs) | ||
| 3478 | { | ||
| 3479 | specpdl_ref count = SPECPDL_INDEX (); | ||
| 3480 | |||
| 3481 | eassert (nargs >= UNEVALLED); | ||
| 3482 | specpdl_ptr->bt.kind = SPECPDL_BACKTRACE; | ||
| 3483 | specpdl_ptr->bt.debug_on_exit = false; | ||
| 3484 | specpdl_ptr->bt.function = function; | ||
| 3485 | current_thread->stack_top = specpdl_ptr->bt.args = args; | ||
| 3486 | specpdl_ptr->bt.nargs = nargs; | ||
| 3487 | grow_specpdl (); | ||
| 3488 | |||
| 3489 | return count; | ||
| 3490 | } | ||
| 3491 | |||
| 3457 | /* This structure helps implement the `catch/throw' and `condition-case/signal' | 3492 | /* This structure helps implement the `catch/throw' and `condition-case/signal' |
| 3458 | control structures. A struct handler contains all the information needed to | 3493 | control structures. A struct handler contains all the information needed to |
| 3459 | restore the state of the interpreter after a non-local jump. | 3494 | restore the state of the interpreter after a non-local jump. |