From 43ad730c29205b90cbf6fcc4ef5ddde31b225f54 Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Thu, 31 Oct 2024 11:54:27 +0000 Subject: [PATCH] PAL::haiku finally supports getentropy. (#684) Also fixing the build with PAL::posix assuming the intent is to avoid using std namespace for max but rather using the in-house implementation. --- src/snmalloc/pal/pal_haiku.h | 9 --------- src/snmalloc/pal/pal_posix.h | 3 ++- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/snmalloc/pal/pal_haiku.h b/src/snmalloc/pal/pal_haiku.h index bafe23c48..bbc9e077c 100644 --- a/src/snmalloc/pal/pal_haiku.h +++ b/src/snmalloc/pal/pal_haiku.h @@ -37,15 +37,6 @@ 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 diff --git a/src/snmalloc/pal/pal_posix.h b/src/snmalloc/pal/pal_posix.h index 2685ba9f4..9526d1d44 100644 --- a/src/snmalloc/pal/pal_posix.h +++ b/src/snmalloc/pal/pal_posix.h @@ -135,7 +135,8 @@ namespace snmalloc bits::is_pow2(SNMALLOC_PAGESIZE), "Page size must be a power of 2"); static constexpr size_t page_size = SNMALLOC_PAGESIZE; #elif defined(PAGESIZE) - static constexpr size_t page_size = max(Aal::smallest_page_size, PAGESIZE); + static constexpr size_t page_size = + bits::max(Aal::smallest_page_size, static_cast(PAGESIZE)); #else static constexpr size_t page_size = Aal::smallest_page_size; #endif