all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Davis Herring" <herring@lanl.gov>
To: "Alin Soare" <as1789@gmail.com>
Cc: Emacs Dev <emacs-devel@gnu.org>
Subject: Re: please help concerning specpdl
Date: Tue, 14 Dec 2010 16:14:50 -0800 (PST)	[thread overview]
Message-ID: <60550.130.55.118.19.1292372090.squirrel@webmail.lanl.gov> (raw)
In-Reply-To: <AANLkTintAorQs8E_BnN2ULX1LPBFFjupO8eBFpWD_HZp@mail.gmail.com>

> Why let-binding-variables are memorized exactly here and not elsewhere ?

Flet memorizes their old values on the stack; when it returns (or
otherwise is exited), the old values are copied back, so they can't be
needed beyond the lifetime of that stack frame.

> why the do-while is good in this case, and not simply brackets?

So that the whole thing is one statement that needs a ;, just like a
normal function call.  If it were brackets, you couldn't do

if(x) SAFE_ALLOCA(...);
else y=x;

> I see that inside unbind_to, the symbols are unbounded 1 by one. Why the
> specpdl_ptr is not decremented directly with count ?

Because you need to do something with each record: restore old values for
symbols, call functions registered with record_unwind_protect(), etc.

> Probably because unbind_to is called from lisp code by (throw 'symbol
> value), and specpdl_ptr must decrement 1 by 1 until the 'symbol is dound
> on the stack ?

catch-tags are searched separately: see struct catchtag.

> Apart from (throw ... ), is which other situation unbind_to is called ?

The other important one is Fsignal (quit and other errors).

> I see that GCPROx macros are used to protect the variables of type Lisp
> Object on the stack of C code (that the compiler creates), not to protect
> the lisp objects in specpdl. The GCPRO protection is against the algorthm
> of conservative stack. Am I right ?

I believe the GCPRO draws the attention of the stack checker to those Lisp
objects to make sure that they're not collected.

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.



  reply	other threads:[~2010-12-15  0:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-04  5:33 please help concerning specpdl Alin Soare
2010-12-06 16:22 ` Davis Herring
2010-12-14 21:25   ` Alin Soare
2010-12-15  0:14     ` Davis Herring [this message]
2010-12-15  0:53       ` Ken Raeburn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=60550.130.55.118.19.1292372090.squirrel@webmail.lanl.gov \
    --to=herring@lanl.gov \
    --cc=as1789@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.