chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] [PATCH] Another symbol GC sanity check fix [was: Re: [


From: Peter Bex
Subject: [Chicken-hackers] [PATCH] Another symbol GC sanity check fix [was: Re: [PATCH] Fix record type tags to be nonglobal by module-prefixing them]
Date: Tue, 18 Jul 2017 22:52:01 +0200
User-agent: NeoMutt/20170113 (1.7.2)

On Tue, Jul 18, 2017 at 09:55:21AM +1200, Evan Hanson wrote:
> Regarding whether to namespace the core record types, I think we
> probably _should_ do so, but it's not a priority.

Fun fact: Because we now define it as a symbol, we trigger another
GC sanity check assertion failure...

The problem is that it assumes that all symbols that are bound to
themselves are keywords.  However, (define foo 'foo) proves that
this is not necessarily the case.

Here's another attempt at improving the sanity check, but if this
keeps cropping up we might as well just get rid of the sanity check.
On the other hand, it does point out several issues, so maybe it's
useful after all:

- Any symbol that starts with \x00 is seen as a keyword, which isn't
   really true (even if unbound or bound to some other value).
   This also has an impact on how these symbols are written.
- This means that any symbol that was defined to itself and then
   got its plist modified and reset would be registered as
   collectible (because the propset would think it's a keyword)
   even though it was still bound.
- In general, we can't really distinguish between keywords and
   symbols.

The attached patch also tries to make it easier to change how
keywords are represented.

In short, I expect that now the assertion (also the one not in
the DEBUGBUILD) will still trigger if you have a symbol that's
bound to itself, and starts with \x00.  I hope that's an
acceptably rare situation.

Cheers,
Peter

Attachment: 0001-Introduce-an-inline-helper-function-to-check-for-key.patch
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

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