guile-devel
[Top][All Lists]
Advanced

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

Re: Issues holding up 1.6.0 release.


From: Marius Vollmer
Subject: Re: Issues holding up 1.6.0 release.
Date: 20 Sep 2001 02:12:54 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.102

Gary Houston <address@hidden> writes:

> static void
> before (void *unused)
> {
>   SCM_SEQ (scm_rootcont) = ++n_dynamic_roots;
> }

Do you really want to increase the seqno on every `before' event?  I'd
say (without really looking) it should be enough to just swap in the
new seqno.  Like

struct seqnos {
  unsigned long old;
  unsigned long new;
};

static void
before (void *s)
{
  SCM_SEQ (scm_rootcont) = ((struct seqnos *)s)->new;
}

static void
after (void *s)
{
  SCM_SEQ (scm_rootcont) = ((struct seqnos *)s)->old;
}

SCM 
scm_c_with_continuation_barrier (scm_t_catch_body body, void *body_data)
{
  struct seqnos s;
  s.old = SCM_SEQ (scm_rootcont);
  s.new = ++n_dynamic_roots;

  return scm_internal_dynamic_wind (before, body, after, body_data, &s);
}

For extra points, we might also want to check "++n_dynamic_roots" for
overflow.  When that happens, we might scan the heap for live
continuations and try to carve out a nice linear chunk of unused
numbers to reuse.



reply via email to

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