You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I usually blindly trust anything with the name kmett attached, but I'm experiencing some behavior where distinct interned values come back with the same Id. I can verify that they belong to the same cache bucket (i.e. their modulus is the same wrt the cacheWidth) and that they have distinct hashes.
The setup for my work is open source but it's quite involved. I can share code if needed but looking for a high level answer first. I'm not an unsafePerformIO guru, but under what conditions is using intern safe? Are race conditions possible? Can compiler optimizations effect the outcome?
In fact, since this whole thing is predicated based on unique Int hashes, why have this Id be some formulaic incremented value instead of just using hash . describe ?
NOTE: When I stop using the formula based on current cache state for the Id and instead switch to hash . describe I dont have any more problems
The text was updated successfully, but these errors were encountered:
martyall
changed the title
Is this library actually safe?
Is this library safe?
May 2, 2024
I usually blindly trust anything with the name kmett attached, but I'm experiencing some behavior where distinct interned values come back with the same
Id
. I can verify that they belong to the same cache bucket (i.e. their modulus is the same wrt thecacheWidth
) and that they have distinct hashes.The setup for my work is open source but it's quite involved. I can share code if needed but looking for a high level answer first. I'm not an
unsafePerformIO
guru, but under what conditions is usingintern
safe? Are race conditions possible? Can compiler optimizations effect the outcome?In fact, since this whole thing is predicated based on unique
Int
hashes, why have thisId
be some formulaic incremented value instead of just usinghash . describe
?NOTE: When I stop using the formula based on current cache state for the
Id
and instead switch tohash . describe
I dont have any more problemsThe text was updated successfully, but these errors were encountered: