help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `max-specpdl-size' and `max-lisp-eval-depth'


From: tomas
Subject: Re: `max-specpdl-size' and `max-lisp-eval-depth'
Date: Sun, 26 Sep 2021 09:13:51 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Sep 26, 2021 at 02:33:51PM +0800, Hongyi Zhao wrote:

[...]

> What's the meaning of `specpdl'?

Ask Emacs. Go to the Emacs Lisp info (in an Emacs windows, do C-h i
and m "Elisp" or whatever equivalent there is in your operating
system).

Then enter "i" (means "index") and then "specpdl". The first hit
will tell you:

 -- User Option: max-specpdl-size
     This variable defines the limit on the total number of local
     variable bindings and ‘unwind-protect’ cleanups (see *note Cleaning
     Up from Nonlocal Exits: Cleanups.) that are allowed before Emacs
     signals an error (with data ‘"Variable binding depth exceeds
     max-specpdl-size"’).

     This limit, with the associated error when it is exceeded, is one
     way that Lisp avoids infinite recursion on an ill-defined function.
     ‘max-lisp-eval-depth’ provides another limit on depth of nesting.
     *Note Eval: Definition of max-lisp-eval-depth.

     The default value is 1600.  Entry to the Lisp debugger increases
     the value, if there is little room left, to make sure the debugger
     itself has room to execute.

So that is a kind of stack, but not for "normal" function returns,
but rather for unwind-protects and other nonlocal exit paths.

Cheers
 - t

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]