4 ms·
So this would be hashing the pointer? In which case it doesn't support keys, like strings, etc. I'm now wondering if this is the more common use case for hash t
by paavoova 8y ago
So this would be hashing the pointer? In which case it doesn't support keys, like strings, etc. I'm now wondering if this is the more common use case for hash tables, where you just need a reference to a unique object rather than a specific key.
- taeric 8y agoJava has IdentityHashMap for this use. I hesitate to claim it is more common.
- xtacy 8y agoNo, that's not true. The insert function (hash, rbtree, etc.) takes a hash node as an argument. So, in the kernel implementation the caller is expected to hash. EDIT: check out some examples to see for yourself: https://elixir.bootlin.com/linux/latest/ident/hlist_add_head https://elixir.bootlin.com/linux/latest/ident/hlist_add_head