unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Marius Vollmer <mvo@zagadka.de>
Cc: guile-devel@gnu.org
Subject: Re: module GC bug
Date: Thu, 14 Jul 2005 00:02:29 +0300	[thread overview]
Message-ID: <87irzeh122.fsf@zagadka.de> (raw)
In-Reply-To: <42CEF39F.2040608@xs4all.nl> (Han-Wen Nienhuys's message of "Fri, 08 Jul 2005 23:43:59 +0200")

Han-Wen Nienhuys <hanwen@xs4all.nl> writes:

>> I think the right fix is to change the weak hashtable marking
>> algorithm to properly cope with circular references like this.  I will
>> try this and then come back to you.  
>
> Interesting. How would you go about doing that?

The marking would would rougly look like this (some special cases are
not considered, like improper alists):

    mark OBJ:
      if mark of OBJ is set:
        return
      set mark of OBJ
      if OBJ is a weak vector
        put it on POSTPONED_OBJECTS
      else
        mark references of OBJ

    gc:
      POSTPONED_OBJECTS = '()
      mark all root references
      while POSTPONED_OBJECTS not empty
        OBJS = POSTPONED_OBJECTS
        POSTPONED_OBJECTS = '()
        mark_weak_vector all OBJS
      sweep   

    mark_weak_vector OBJ:
      for all elements ELT of OBJ:
        for all pairs P on list ELT:
          if P is marked, break
          ITEM = car of P
          if ITEM is a pair:
            if (OBJ has weak keys and car of ITEM is unmarked)
            or (OBJ has weak values and cdr of ITEM is unmarked)
              remove P from ELT
            else:
              mark ITEM (recursively)
              set mark of P

The non-trivial stuff is to integrate this properly with the abstract
hashtables (but I have basically done this already as well).

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2005-07-13 21:02 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-09 23:32 module GC bug Han-Wen Nienhuys
2005-06-10  6:32 ` Neil Jerram
2005-06-10 11:48   ` Han-Wen Nienhuys
2005-06-19 13:32   ` Han-Wen Nienhuys
2005-06-19 17:33     ` Rob Browning
2005-07-07 18:48     ` Marius Vollmer
2005-06-24 17:50   ` Han-Wen Nienhuys
2005-07-07 18:42 ` Marius Vollmer
2005-07-08  9:24   ` Mikael Djurfeldt
2005-07-09  8:28     ` Han-Wen Nienhuys
2005-07-09 19:28       ` Mikael Djurfeldt
2005-07-09 23:25         ` Han-Wen Nienhuys
2005-07-10  8:16           ` Mikael Djurfeldt
2005-07-09 23:32         ` Han-Wen Nienhuys
2005-07-10  8:17           ` Mikael Djurfeldt
2005-07-08 21:43   ` Han-Wen Nienhuys
2005-07-13 21:02     ` Marius Vollmer [this message]
2005-07-13 22:19       ` Han-Wen Nienhuys
2005-07-16 18:57         ` Marius Vollmer
2005-07-17 18:50           ` Han-Wen Nienhuys
2005-07-17 20:44             ` Marius Vollmer
2005-07-18 13:43               ` Han-Wen Nienhuys
2005-08-01  0:20 ` Marius Vollmer
2005-08-01 11:04   ` Han-Wen Nienhuys
2005-08-10 22:29     ` Marius Vollmer
2005-08-15 23:57       ` Rob Browning
2005-08-16  0:10         ` Marius Vollmer
2005-08-16  0:16         ` Rob Browning
2005-08-28 23:31           ` Han-Wen Nienhuys
     [not found]   ` <42EE63F9.4080102@xs4all.nl>
2005-08-02 19:14     ` Marius Vollmer
     [not found]   ` <42F1DF3E.70204@xs4all.nl>
2005-08-05 14:48     ` Han-Wen Nienhuys

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/guile/

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

  git send-email \
    --in-reply-to=87irzeh122.fsf@zagadka.de \
    --to=mvo@zagadka.de \
    --cc=guile-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.
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).