diff options
author | Yves Orton <demerphq@gmail.com> | 2013-05-07 23:52:16 +0200 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2013-05-08 00:10:45 +0200 |
commit | e6b54db65c0cdda6ff40959415e828972b6a92b5 (patch) | |
tree | e1fa02fffce3b0b347ed1258ab3e678275d55809 /hv.h | |
parent | a2098e2036fea6a0d6544c47278aea9193a203c2 (diff) | |
download | perl-e6b54db65c0cdda6ff40959415e828972b6a92b5.tar.gz |
document and improve hash algorithm randomization related build options
Install was a copy of other material, made heavy reference to 5.8.x and
and didnt really document what it should have. I reworked it to be more
up to date.
Diffstat (limited to 'hv.h')
-rw-r--r-- | hv.h | 22 |
1 files changed, 13 insertions, 9 deletions
@@ -11,17 +11,21 @@ /* These control hash traversal randomization and the environment variable PERL_PERTURB_KEYS. * Currently disabling this functionality will break a few tests, but should otherwise work fine. * See perlrun for more details. */ -#define PERL_HASH_RANDOMIZE_KEYS 1 -#define USE_PERL_PERTURB_KEYS 1 - -#ifdef PERL_HASH_RANDOMIZE_KEYS -# if defined(DEBUGGING) || defined(USE_PERL_PERTURB_KEYS) -# define PL_HASH_RAND_BITS_ENABLED PL_hash_rand_bits_enabled -# endif -# define PERL_HASH_ITER_BUCKET(iter) (((iter)->xhv_riter) ^ ((iter)->xhv_rand)) +#if defined(PERL_PERTURB_KEYS_DISABLED) +# define PL_HASH_RAND_BITS_ENABLED 0 +# define PERL_HASH_ITER_BUCKET(iter) ((iter)->xhv_riter) #else -# define PERL_HASH_ITER_BUCKET(iter) ((iter)->xhv_riter) +# define PERL_HASH_RANDOMIZE_KEYS 1 +# if defined(PERL_PERTURB_KEYS_RANDOM) +# define PL_HASH_RAND_BITS_ENABLED 1 +# elif defined(PERL_PERTURB_KEYS_DETERMINISTIC) +# define PL_HASH_RAND_BITS_ENABLED 2 +# else +# define USE_PERL_PERTURB_KEYS 1 +# define PL_HASH_RAND_BITS_ENABLED PL_hash_rand_bits_enabled +# endif +# define PERL_HASH_ITER_BUCKET(iter) (((iter)->xhv_riter) ^ ((iter)->xhv_rand)) #endif /* entry in hash value chain */ |