From 1b8aa6bc0d33e06c3f8d2ecf26ba3601da5c6967 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Wed, 25 May 2022 21:08:21 +0000 Subject: [PATCH] Haiku build fix post refactoring. --- src/snmalloc/pal/pal_haiku.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/snmalloc/pal/pal_haiku.h b/src/snmalloc/pal/pal_haiku.h index 9cc2b8d..bafe23c 100644 --- a/src/snmalloc/pal/pal_haiku.h +++ b/src/snmalloc/pal/pal_haiku.h @@ -20,7 +20,7 @@ namespace snmalloc * PAL supports. * */ - static constexpr uint64_t pal_features = PALPOSIX::pal_features; + static constexpr uint64_t pal_features = PALPOSIX::pal_features | Entropy; /** * Haiku requires an explicit no-reserve flag in `mmap` to guarantee lazy @@ -37,6 +37,15 @@ namespace snmalloc SNMALLOC_ASSERT(is_aligned_block(p, size)); posix_madvise(p, size, POSIX_MADV_DONTNEED); } + + /** + * Hopefully a temporary workaround until the kernel random feature + * is exposed properly in the userspace ? + */ + static uint64_t get_entropy64() + { + return PALPOSIX::dev_urandom(); + } }; } // namespace snmalloc #endif