chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] [PATCH] Set hash-table size to number of entries in ha


From: Christian Kellermann
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
User-agent: Mutt/1.5.21 (2010-09-15)

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 ;)

Christian

--
9 out of 10 voices in my head say, that I am crazy,
one is humming.

Attachment: 0001-Set-hash-table-size-to-number-of-entries-in-hash-tab.patch
Description: Text document


reply via email to

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