emacs-devel
[Top][All Lists]
Advanced

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

Re: master 724af76 2/2: Fix sxhash-equal on bytecodes, markers, etc.


From: Stefan Monnier
Subject: Re: master 724af76 2/2: Fix sxhash-equal on bytecodes, markers, etc.
Date: Tue, 07 Jan 2020 18:37:43 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> Again, I don't think there's any reason for using markers as keys in
>> an equal-based hash table. But if you do, what you probably meant was
>> to use an eq-based hash table, and that used to work; now it doesn't.
>>
>> (puthash marker value ht)
>> <...move marker...>
>> (gethash marker ht)
>
> If it hurts don't do that: the same happens with
>
>     (puthash conscell value ht)
>     <...setcar conscell...>
>     (gethash conscell ht)

BTW, id we really wanted it, we could make that work as you expect by
making sxhash only return a value that does not depend on the properties
that can be modified (i.e. doesn't depend on the cons's car and car nor
the marker's current position), but it would lead to lots of objects
with equal hash, hence poor hashing performance.


        Stefan




reply via email to

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