From: Neil Jerram <neil@ossau.uklinux.net>
To: ludo@gnu.org (Ludovic Courtès)
Cc: guile-devel@gnu.org
Subject: Re: SCM_BOOL_F == 0 and BDW-GC
Date: Thu, 17 Sep 2009 23:00:33 +0100 [thread overview]
Message-ID: <87iqfhgrjy.fsf@ossau.uklinux.net> (raw)
In-Reply-To: <87zl9fps1m.fsf_-_@gnu.org> ("Ludovic Courtès"'s message of "Mon, 31 Aug 2009 23:55:17 +0200")
ludo@gnu.org (Ludovic Courtès) writes:
> Hello!
>
> Neil Jerram <neil@ossau.uklinux.net> writes:
>
>> Just checking this because Ludovic said recently that (SCM_BOOL_F ==
>> 0) would have nice properties for BDW-GC.
>
> Actually he wasn't quite right when he said that. :-)
>
> The issue with BDW-GC is that "disappearing links" (weak pointers in
> libgc parlance) replace pointers to objects that have been reclaimed by
> NULL, and there's no way to tell it to use some other value.
>
> That leads to insanities in the weak hash table implementation [0, 1],
> which I thought could somehow vanish if SCM_BOOL_F == 0.
They're not so bad. But I agree that it would be nicer not to have to
use SCM_WEAK_PAIR_CAR, and just use SCM_CAR instead.
> Unfortunately that's not true; it would even make things worse because
> NULL would now be a valid Scheme value.
Yes, I see.
> Instead what's really needed is a special pointer-to-reclaimed-object
> value that can be distinguished from valid Scheme values since that
> value ends up in the car or cdr of weak pairs in hash table buckets. As
> such, SCM_PACK (NULL) was a good choice until now.
Here I'm confused again. I thought we now had no choice about the
pointer-to-reclaimed-object value, because BDW-GC always uses NULL.
> SCM_UNDEFINED == 0 would work fine because SCM_UNDEFINED is not a valid
> Scheme value, but it wouldn't change the implementation.
I'm afraid I don't understand "but it wouldn't change the
implementation".
0 is also used for procedures that haven't been extended to
primitive-generic - see SCM_SUBR_GENERIC - but I think making
SCM_UNDEFINED == 0 would be fine there too.
> Thoughts?
SCM_UNDEFINED == 0 is sounding promising...
Neil
next prev parent reply other threads:[~2009-09-17 22:00 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-29 21:12 truth of %nil Andy Wingo
2009-06-29 21:44 ` Neil Jerram
2009-06-29 22:11 ` Andy Wingo
2009-06-30 22:22 ` Neil Jerram
2009-07-01 6:45 ` Daniel Kraft
2009-07-01 21:54 ` Neil Jerram
2009-07-05 13:07 ` Mark H Weaver
2009-08-30 11:07 ` Neil Jerram
2009-08-30 14:11 ` Mark H Weaver
2009-09-01 22:00 ` Neil Jerram
2009-09-02 15:57 ` Mark H Weaver
2009-09-17 21:21 ` Neil Jerram
2009-07-02 14:28 ` Mark H Weaver
2009-07-02 14:50 ` Ludovic Courtès
2009-07-02 22:50 ` Neil Jerram
2009-07-03 15:32 ` Mark H Weaver
2009-07-05 2:41 ` Mark H Weaver
2009-07-05 9:19 ` Andy Wingo
2009-07-07 11:14 ` Mark H Weaver
2009-07-08 13:17 ` Mark H. Weaver
2009-08-30 11:20 ` Neil Jerram
2009-08-30 11:13 ` Neil Jerram
2009-08-30 14:15 ` Mark H Weaver
2009-09-01 21:50 ` Neil Jerram
2009-08-30 22:01 ` Ken Raeburn
2009-08-31 21:59 ` Ludovic Courtès
2009-08-31 23:39 ` Ken Raeburn
2009-08-31 21:55 ` SCM_BOOL_F == 0 and BDW-GC Ludovic Courtès
2009-09-17 22:00 ` Neil Jerram [this message]
2009-09-17 22:28 ` Ludovic Courtès
2009-09-18 20:51 ` Neil Jerram
2009-09-20 17:21 ` Ludovic Courtès
2009-09-20 21:03 ` Neil Jerram
2009-09-20 21:36 ` Ludovic Courtès
2009-07-06 21:46 ` truth of %nil Neil Jerram
2009-07-06 23:54 ` Mark H Weaver
2009-07-08 8:08 ` Ludovic Courtès
2009-07-23 21:12 ` Andy Wingo
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=87iqfhgrjy.fsf@ossau.uklinux.net \
--to=neil@ossau.uklinux.net \
--cc=guile-devel@gnu.org \
--cc=ludo@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).