summaryrefslogtreecommitdiffstats
path: root/src/prof.c
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2016-02-10 00:28:40 (GMT)
committerJason Evans <jasone@canonware.com>2016-02-20 04:29:06 (GMT)
commit34676d33690f6cc6885ff769e537ca940aacf886 (patch)
tree9cb1c620c553becca5c7f40641c00ec31d65094a /src/prof.c
parentc87ab25d189e0ae76fd568db4bf273e2788cf1a9 (diff)
downloadjemalloc-34676d33690f6cc6885ff769e537ca940aacf886.zip
jemalloc-34676d33690f6cc6885ff769e537ca940aacf886.tar.gz
jemalloc-34676d33690f6cc6885ff769e537ca940aacf886.tar.bz2
Refactor prng* from cpp macros into inline functions.
Remove 32-bit variant, convert prng64() to prng_lg_range(), and add prng_range().
Diffstat (limited to 'src/prof.c')
-rw-r--r--src/prof.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/prof.c b/src/prof.c
index 199e63e..31f5e60 100644
--- a/src/prof.c
+++ b/src/prof.c
@@ -871,8 +871,7 @@ prof_sample_threshold_update(prof_tdata_t *tdata)
* pp 500
* (http://luc.devroye.org/rnbookindex.html)
*/
- prng64(r, 53, tdata->prng_state, UINT64_C(6364136223846793005),
- UINT64_C(1442695040888963407));
+ r = prng_lg_range(&tdata->prng_state, 53);
u = (double)r * (1.0/9007199254740992.0L);
tdata->bytes_until_sample = (uint64_t)(log(u) /
log(1.0 - (1.0 / (double)((uint64_t)1U << lg_prof_sample))))