summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-07-23 13:28:52 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-07-23 13:28:52 +0000
commit830b38bd9aba3b182891b9a2d5cae8a220294dee (patch)
tree9e27fe71ad48090f0aaccec4e0b392c684942e32 /hv.h
parent71c9e11c8d320b29fd87c15e0557fc3957df10f4 (diff)
downloadperl-830b38bd9aba3b182891b9a2d5cae8a220294dee.tar.gz
This should make Stas happy.
p4raw-id: //depot/perl@20182
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/hv.h b/hv.h
index c43fc57b2d..e4149796ea 100644
--- a/hv.h
+++ b/hv.h
@@ -56,13 +56,22 @@ struct xpvhv {
* (a) the hashed data being interpreted as "unsigned char" (new since 5.8,
* a "char" can be either signed or signed, depending on the compiler)
* (b) catering for old code that uses a "char"
+ *
* The "hash seed" feature was added in Perl 5.8.1 to perturb the results
* to avoid "algorithmic complexity attacks".
+ *
+ * If USE_HASH_SEED is defined, hash randomisation is done by default
+ * If USE_HASH_SEED_EXPLICIT is defined, hash randomisation is done
+ * only if the environment variable PERL_HASH_SEED is set.
+ * For maximal control, one can define PERL_HASH_SEED.
+ * (see also erl.c:perl_parse()).
*/
-#if defined(USE_HASH_SEED) || defined(USE_HASH_SEED_EXPLICIT)
-# define PERL_HASH_SEED PL_hash_seed
-#else
-# define PERL_HASH_SEED 0
+#ifndef PERL_HASH_SEED
+# if defined(USE_HASH_SEED) || defined(USE_HASH_SEED_EXPLICIT)
+# define PERL_HASH_SEED PL_hash_seed
+# else
+# define PERL_HASH_SEED 0
+# endif
#endif
#define PERL_HASH(hash,str,len) \
STMT_START { \