unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludovic.courtes@laas.fr (Ludovic Courtès)
Cc: guile-devel@gnu.org
Subject: Re: [PATCH] Marking weak alist vectors
Date: Wed, 09 Nov 2005 10:03:15 +0100	[thread overview]
Message-ID: <87lkzyyyzw.fsf@laas.fr> (raw)
In-Reply-To: <874q6m7l6d.fsf@zagadka.de> (Marius Vollmer's message of "Wed, 09 Nov 2005 01:51:38 +0200")

Hi Marius,

Marius Vollmer <mvo@zagadka.de> writes:

> I still have to read your patch carefully, but just from your
> description of the problem, I would say that nothing is actually
> wrong.  We don't make any guarantees about the sequence in which
> objects are 'freed' that are unreachable.
>
> This should only matter for smobs with their user written FREE
> procedures.  The manual says:

[About SMOBs' being freed]

The relevant part of the manual with respect to this issue is the
following (in node `Weak References'):

     Weak references let you attach bookkeeping information to data so
  that the additional information automatically disappears when the
  original data is no longer in use and gets garbage collected. In a weak
  key hash, the hash entry for that key disappears as soon as the key is
  no longer referenced from anywhere else.

Likewise (in `Object Properties'):

     Internally, object properties are implemented using a weak key hash
  table.  This means that, as long as a Scheme value with property values
  is protected from garbage collection, its property values are also
  protected.  When the Scheme value is collected, its entry in the
  property table is removed and so the (ex-) property values are no longer
  protected by the table.

IOW, property values are to be "collected" _after_ the Scheme value to
which they are attached has been collected.  Admittedly, the manual is
quite fuzzy as to whether "after" means "during the next round of
mark/sweep" or "maybe during the same round of mark/sweep but at least
property values are swept after the Scheme value has been swept".

In any case, if a value P is attached as a property of some object O,
then O should be "collected" _before_ P.  In practice, if both O and P
are SMOBs, then this means that O should be "freed" before P.

Please, have a look at the `test-weaks.c' file I posted.  It attaches
SMOBs as properties of other SMOBs.  And it's maybe clearer than long
explanations.  ;-)

Thanks,
Ludovic.


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


  reply	other threads:[~2005-11-09  9:03 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-08 17:22 [PATCH] Marking weak alist vectors Ludovic Courtès
2005-11-08 23:51 ` Marius Vollmer
2005-11-09  9:03   ` Ludovic Courtès [this message]
2005-12-06 23:55     ` Marius Vollmer
2005-12-07 10:33       ` Ludovic Courtès
2005-12-13 23:45         ` Marius Vollmer
2005-12-14  9:30           ` Ludovic Courtès
2005-11-09 10:28 ` Han-Wen Nienhuys
2005-11-09 16:28   ` Ludovic Courtès
2005-11-09 18:36     ` Han-Wen Nienhuys
2005-11-09 21:11     ` Kevin Ryde
2005-11-09 22:45       ` Marius Vollmer
2005-11-10 12:11         ` Han-Wen Nienhuys
2005-11-10  9:47       ` [PATCH] Reference leak in `iprin1 ()' Ludovic Courtès
2005-11-12  9:23         ` Neil Jerram
2005-11-14  9:58           ` Ludovic Courtès
2005-11-16 21:18             ` Neil Jerram
2005-11-17  9:54               ` Ludovic Courtès
2005-11-17 18:52                 ` Neil Jerram
2005-11-23 10:19     ` [PATCH] Marking weak alist vectors, #2 Ludovic Courtès
2005-11-24  0:59       ` Han-Wen Nienhuys
2005-11-24  9:01         ` Ludovic Courtès
2005-11-26  0:49       ` Kevin Ryde
2006-01-09 14:51       ` [PATCH] Marking weak alist vectors, epilogue Ludovic Courtès
2006-01-09 19:29         ` Neil Jerram
2006-01-10  8:21           ` Ludovic Courtès
2006-01-10  9:33             ` Neil Jerram
2006-01-10 15:43               ` Ludovic Courtès
2005-11-17 13:21 ` [PATCH] Fixing `gc-live-object-stats' Ludovic Courtès
2005-11-17 14:12   ` Han-Wen Nienhuys
2005-11-30  8:54   ` Ludovic Courtès
2005-11-30 23:45     ` Han-Wen Nienhuys
2005-12-03 19:31       ` Neil Jerram
2005-12-05  8:50         ` Ludovic Courtès
2005-12-06 19:14           ` Neil Jerram

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=87lkzyyyzw.fsf@laas.fr \
    --to=ludovic.courtes@laas.fr \
    --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).