| 1358 | * mixed in, so two strings that share a long prefix still differ. */ |
| 1359 | enum { MEMEV_CONTENT_HASH_MAX = 4096 }; |
| 1360 | static uint64_t bytes_hash(const char *s, size_t len) { |
| 1361 | uint64_t h = 0xcbf29ce484222325ULL ^ (uint64_t)len; |
| 1362 | size_t n = len < MEMEV_CONTENT_HASH_MAX ? len : MEMEV_CONTENT_HASH_MAX; |
| 1363 | for (size_t i = 0; s && i < n; i++) { |
| 1364 | h ^= (uint8_t)s[i]; |
| 1365 | h *= 0x100000001b3ULL; |
| 1366 | } |
| 1367 | return h; |
| 1368 | } |
| 1369 | |
| 1370 | void cbm_work_note_strlen(void *site, const char *s, size_t len) { |
| 1371 | if (!cbm_memev_enabled()) { |
no outgoing calls
no test coverage detected