summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2013-05-07 23:52:16 +0200
committerYves Orton <demerphq@gmail.com>2013-05-08 00:10:45 +0200
commite6b54db65c0cdda6ff40959415e828972b6a92b5 (patch)
treee1fa02fffce3b0b347ed1258ab3e678275d55809 /hv.h
parenta2098e2036fea6a0d6544c47278aea9193a203c2 (diff)
downloadperl-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.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/hv.h b/hv.h
index 0d619f2139..2eea4779c1 100644
--- a/hv.h
+++ b/hv.h
@@ -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 */