http://qs321.pair.com?node_id=11148641


in reply to Unsigned 64-bit integer as Judy key

Do Judy arrays index from 1 instead of zero? Subtracting 1 from the key works without error.

perl -MJudy::L=Set -E 'Set($j, (1<<63)-1, 123); say $j' 94763462791888

And possibly not relevant, but I see these overflow warnings when compiling:

ib/Judy.xs:54:37: note: in definition of macro ‘OOGA’ 54 | PerlIO_printf(PerlIO_stdout(),__VA_ARGS__);\ | ^~~~~~~~~~~ lib/Judy.xs: In function ‘XS_Judy__HS_Delete’: lib/Judy.xs:46:26: warning: overflow in conversion from ‘long unsigned + int’ to ‘int’ changes value from ‘16045690984833335023’ to ‘-5590387 +37’ [-Woverflow] 46 | # define DEADBEEF 0xdeadbeefdeadbeef | ^~~~~~~~~~~~~~~~~~ lib/Judy.xs:46:26: note: in definition of macro ‘DEADBEEF’ 46 | # define DEADBEEF 0xdeadbeefdeadbeef | ^~~~~~~~~~~~~~~~~~

Perl version:

perl -v | grep This This is perl 5, version 36, subversion 0 (v5.36.0) built for x86_64-li +nux