summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2016-05-18 15:03:14 +1000
committerTony Cook <tony@develop-help.com>2017-09-11 10:59:42 +1000
commitf26b33bdaa1e41fbaf65c649a3208f081fa7571b (patch)
tree08ebd8b38bf725af3bd0a77465a1916229812aaf /util.h
parent3ff4feb5bd226622062600b4127bb8c276c9d5ec (diff)
downloadperl-f26b33bdaa1e41fbaf65c649a3208f081fa7571b.tar.gz
(perl #127663) create a separate random source for internal use
and use it to initialize hash randomization and to innoculate against quadratic behaviour in pp_sort
Diffstat (limited to 'util.h')
-rw-r--r--util.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/util.h b/util.h
index 12a1c470ee..4589808ee1 100644
--- a/util.h
+++ b/util.h
@@ -89,6 +89,12 @@ typedef struct PERL_DRAND48_T perl_drand48_t;
#define Perl_drand48_init(seed) (Perl_drand48_init_r(&PL_random_state, (seed)))
#define Perl_drand48() (Perl_drand48_r(&PL_random_state))
+#ifdef PERL_CORE
+/* uses a different source of randomness to avoid interfering with the results
+ * of rand() */
+#define Perl_internal_drand48() (Perl_drand48_r(&PL_internal_random_state))
+#endif
+
#ifdef USE_C_BACKTRACE
typedef struct {