Hello again,

Actually, I need to retract what I said before. Here is what I think
is actually going on, and it means that the current code is correct.

min_size_index will usually be 0, which means the table can shrink
down to the minimum hash table size (31). The only case it won't be 0
is if the hash table was created by passing a size argument to
make-hash-table, in which case min_size_index will be whatever it
needs to be so that the table will never shrink below the size
specified to make-hash-table. This is consistent with the
documentation, which says that a table created with a given size will
always be at least that large.

Sorry about that. I'll work on hash sets now.

Noah

On Mon, Jan 17, 2011 at 4:27 PM, Ludovic Courtès <[email protected]> wrote:
> Hi Noah!
>
> Noah Lavine <[email protected]> writes:
>
>> I started looking into implementing this, and I ran into something
>> strange that I'd like clarification on. Am I correct in saying that
>> currently, hash tables can only shrink by one size index when they are
>> rehashed?
>
> Yes, your analysis looks correct to me.  Would you like to look into
> fixing this?  :-)
>
> I suppose the trick would be to regularly recompile ‘min_size_index’
> based on the current ‘SCM_HASHTABLE_N_ITEMS’, iterating on
> HASHTABLE_SIZE, starting from the current ‘min_size_index’.
>
> Thanks,
> Ludo’.
>
>
>

Reply via email to