chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] [PATCH] Fix #1576 by changing keyword representation a


From: Peter Bex
Subject: [Chicken-hackers] [PATCH] Fix #1576 by changing keyword representation and location
Date: Sat, 6 Apr 2019 20:05:19 +0200
User-agent: NeoMutt/20170113 (1.7.2)

Hi all,

Attached patches fix #1576.  The first patch should be applied first,
then you should build CHICKEN via a bootstrap CHICKEN.  Then, install
it and apply the second patch and rebuild again.

Aside from the bootstrapping dance, it is a relatively straightforward
change: Keywords are now kept in a different hash table than regular
symbols, which allows us to remove the NUL prefix and avoid name clashes.

It also changes keywords so they no longer have a plist.  Strictly
speaking this *should* not be necessary, because you can just look up the
symbol in the keyword table (and if you find it, it was a keyword), but
the reason I decided to do it this way is that this is a O(1) operation
while the hash table lookup is O(n) where n is the length of the bucket's
chain, and even more importantly, the sanity checks in the GC which check
if the symbol is persistable would break by doing the lookup, because the
symbol table can contain forwarded pointers, which complicates things a
lot.

A few minor remaining questions:

- What should the (initial) size of the keyword table be?
- Should we use "symbols" in CHICKEN_initialize to determine the
   keyword table size as well?

Cheers,
Peter

Attachment: 0001-Change-representation-of-keywords.patch
Description: Text Data

Attachment: 0002-Drop-backwards-compat-support-for-keywords-as-NUL-pr.patch
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

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