We use the number divided by two as the hash (for lots of collisions), plus set all the higher bits so we can detect if they don't get masked out. */
| 14 | collisions), plus set all the higher bits so we can detect if they |
| 15 | don't get masked out. */ |
| 16 | static size_t hash(const void *elem, void *unused UNNEEDED) |
| 17 | { |
| 18 | size_t h; |
| 19 | |
| 20 | /* With CCAN_HTABLE_DEBUG enabled, it will try to hash each element, |
| 21 | * including this one... */ |
| 22 | if (elem == bad_pointer) |
| 23 | return 0; |
| 24 | |
| 25 | h = *(uint64_t *)elem / 2; |
| 26 | h |= -1UL << NUM_BITS; |
| 27 | return h; |
| 28 | } |
| 29 | |
| 30 | static bool objcmp(const void *htelem, void *cmpdata) |
| 31 | { |
no outgoing calls
no test coverage detected