From 86d84dd06fe16998648c41a393a25a59b9c470b7 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Sat, 6 Aug 2022 22:48:04 +0200 Subject: perl.c - remove code for reporting state of non-existent defines in -V Most of the hash based defines are no longer supported, so remove them. Also at the same time introduce a new simpler way to track which hash function we are using. Also add the info about if SBOX32 is in use. This removes the need to keep the list of hash functions supported in two places, hv_func.h and perl.c. Instead hv_func.h drives the whole process and perl.c just does what it is told. Previously the way to control SBOX32 was to use a define with a value but our perl -V output currently doesnt support that, so this adds some two new defines PERL_HASH_USE_SBOX32 and PERL_HASH_NO_SBOX32 which map to the older PERL_HASH_USE_SBOX32_ALSO flag define (integer 1/0). Both are still supported, this just makes everything more consistent. This also includes minor doc changes to INSTALL to mention -Accflags as being the way to set these defines during the Configure process. --- INSTALL | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) (limited to 'INSTALL') diff --git a/INSTALL b/INSTALL index d405db7a78..a06b27ad98 100644 --- a/INSTALL +++ b/INSTALL @@ -450,30 +450,39 @@ storage with 256 32-bit random values as well. In practice the RNG we use for seeding the SBOX32 storage is very efficient, and populating the table required for hashing even fairly long keys is negligible as we only do it during startup. By default we build with SBOX32 enabled, but you can change -that by setting +that by setting the C in the Configure process, +with something like this - PERL_HASH_USE_SBOX32_ALSO + -Accflags='-DPERL_HASH_USE_SBOX32_ALSO=0' -to zero in configure. By default Perl will use SBOX32 to hash strings 24 bytes -or shorter, you can change this length by setting +or alternatively you can use the simple define C like this: - SBOX32_MAX_LEN + -Accflags='-DPERL_HASH_NO_SBOX32' -to the desired length, with the maximum length being 256. +By default Perl will use SBOX32 to hash strings 24 bytes +or shorter, you can change this length by setting C +to the desired length, with the maximum length being 256. For example with +this: + + -Accflags='-DSBOX_MAX_LEN=128' As of Perl 5.18 the order returned by keys(), values(), and each() is non-deterministic and distinct per hash, and the insert order for colliding keys is randomized as well, and perl allows for controlling this by the PERL_PERTURB_KEYS environment setting. You can disable this behavior -entirely with the define +entirely with the define C with - PERL_PERTURB_KEYS_DISABLED + -Accflags='-DPERL_PERTURB_KEYS_DISABLED' You can disable the environment variable checks and compile time specify -the type of key traversal randomization to be used by defining one of these: +the type of key traversal randomization to be used by defining either +C or C with + + -Accflags='-DPERL_PERTURB_KEYS_RANDOM' + +or - PERL_PERTURB_KEYS_RANDOM - PERL_PERTURB_KEYS_DETERMINISTIC + -Accflags='-DPERL_PERTURB_KEYS_DETERMINISTIC' Since Perl 5.18 the seed used for the hash function is randomly selected at process start, which can be overridden by specifying a seed by setting @@ -489,9 +498,9 @@ DETERMINISTIC in this context means "if everything else is kept the same the same results should be observed". You can change this behavior so that your perl is built with a hard coded -seed with the define +seed with the define C by providing to Configure - NO_HASH_SEED + -Accflags='-DNO_HASH_SEED' Note that if you do this you should modify the code in hv_func.h to specify your own key. In the future this define may be renamed and replaced with one -- cgit v1.2.1