unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Chris Gray <chrismgray@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: tail-call elimination
Date: Mon, 10 Dec 2012 22:17:23 -0500	[thread overview]
Message-ID: <jwv1uexb7o5.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CAK1AjMTeCb9youwGygrrOPPzcK0iL8r-yF7QL1ifT-QQUO3NgQ@mail.gmail.com> (Chris Gray's message of "Mon, 10 Dec 2012 18:57:05 -0800")

> + funargs = xmalloc (nargs * sizeof(Lisp_Object));
> + funargs = *(volatile Lisp_Object *) &funargs;
> +  {
> +    int i;
> +    for (i = 0; i < nargs; i++)
> +      {
> +        funargs[i] = args[i];
> +      }
> +  }
> +  stack.next = byte_stack_list;
> +  byte_stack_list = &stack;

Can you explain what this is doing?

> +   /* uses setjmp/longjmp rather than goto so that the emacs-lisp stack
> +      can be allocated on the CPU stack.  This is what the garbage collector
> +      assumes, so it is preferable to changing the garbage collector.
> +   */

Can you explain a bit more why `goto' wouldn't work?


        Stefan



  reply	other threads:[~2012-12-11  3:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-11  2:57 tail-call elimination Chris Gray
2012-12-11  3:17 ` Stefan Monnier [this message]
2012-12-11  6:13 ` Daniel Colascione
2012-12-11  6:45   ` Chris Gray
2012-12-11 13:34   ` Stefan Monnier
2012-12-11 14:30     ` Wolfgang Jenkner
2012-12-11 15:13       ` Stefan Monnier
2012-12-31 18:16     ` Chris Gray
2013-01-07 18:28       ` Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwv1uexb7o5.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=chrismgray@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).