Changeset 95c675b in mainline for kernel/generic/include/adt/hash.h
- Timestamp:
- 2017-10-17T13:11:35Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 60af4cdb
- Parents:
- dbf32b1 (diff), a416d070 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/adt/hash.h
rdbf32b1 r95c675b 45 45 * Public domain. 46 46 */ 47 hash = ~hash + (hash << 15); 47 hash = ~hash + (hash << 15); 48 48 hash = hash ^ (hash >> 12); 49 49 hash = hash + (hash << 2); 50 50 hash = hash ^ (hash >> 4); 51 hash = hash * 2057; 51 hash = hash * 2057; 52 52 hash = hash ^ (hash >> 16); 53 return hash; 53 return hash; 54 54 } 55 55 … … 65 65 hash = hash ^ (hash >> 4); 66 66 hash = hash * 0x27d4eb2d; 67 hash = hash ^ (hash >> 15); 68 /* 67 hash = hash ^ (hash >> 15); 68 /* 69 69 * Lower order bits are mixed more thoroughly. Swap them with 70 70 * the higher order bits and make the resulting higher order bits … … 105 105 * http://burtleburtle.net/bob/c/lookup3.c 106 106 */ 107 seed ^= hash + 0x9e3779b9 107 seed ^= hash + 0x9e3779b9 108 108 + ((seed << 5) | (seed >> (sizeof(size_t) * 8 - 5))); 109 return seed; 109 return seed; 110 110 } 111 111
Note:
See TracChangeset
for help on using the changeset viewer.