[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] Set hash-table size to number of entries i
From: |
Felix |
Subject: |
Re: [Chicken-hackers] [PATCH] Set hash-table size to number of entries in hash-table-copy |
Date: |
Tue, 17 Jul 2012 13:07:10 +0200 (CEST) |
From: Christian Kellermann <address@hidden>
Subject: [Chicken-hackers] [PATCH] Set hash-table size to number of entries in
hash-table-copy
Date: Mon, 16 Jul 2012 11:48:50 +0200
> Hi,
>
> below is a patch that adresses the issue brought to our attention by
> John Croisant on chicken-users.
>
> Before this patch hash-table-copied tables would report a size of 0.
> This is due to *make-hash-table setting the number of entries to 0
> regardless of the size of the hash-table's vector.
>
> There is a deeper issue here. The size parameter for *make-hash-table
> is used to propagate the vector's size holding the buckets. This
> defaults to 307. For this reason the size *slot* in the
> hash-table-structure is always set to 0.
>
> This patch resets the size slot *after* the call to *make-hash-table
> to the real number of entries.
>
> I am not sure whether *make-hash-table should be rewritten to use the
> size parameter properly though.
>
> On the pro side this patch has no impact on the other procedures
> involved.
>
> Does this help at all ;)
Thanks, Christian - pushed. I think "*make-hash-table" is ok the
way it is.
cheers,
felix