Skip to content

Commit

Permalink
URL doesn't exist anymore so link to a mirror instead
Browse files Browse the repository at this point in the history
Also add some comments
  • Loading branch information
scottchiefbaker authored and demerphq committed Feb 14, 2025
1 parent f5417d4 commit 37513d3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -4647,23 +4647,22 @@ Perl_parse_unicode_opts(pTHX_ const char **popt)
# include <starlet.h>
#endif

/* hash a pointer and return a U32
*
* this code was derived from Sereal, which was derived from autobox.
*/
/* hash a pointer and return a U32 */

PERL_STATIC_INLINE U32 S_ptr_hash(PTRV u) {
/* 64 bit input */
#if PTRSIZE == 8
/*
* This is one of Thomas Wang's hash functions for 64-bit integers from:
* http://www.concentric.net/~Ttwang/tech/inthash.htm
* https://gist.github.com/scottchiefbaker/9e21877a0c6041fbf54bd583cd1c52b4
*/
u = (~u) + (u << 18);
u = u ^ (u >> 31);
u = u * 21;
u = u ^ (u >> 11);
u = u + (u << 6);
u = u ^ (u >> 22);
/* 32 bit input */
#else
/*
* This is one of Bob Jenkins' hash functions for 32-bit integers
Expand Down

0 comments on commit 37513d3

Please sign in to comment.