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.
This commit is contained in:
David CARLIER
2024-10-31 11:54:27 +00:00
committed by GitHub
parent 97b7675670
commit 43ad730c29
2 changed files with 2 additions and 10 deletions

View File

@@ -37,15 +37,6 @@ namespace snmalloc
SNMALLOC_ASSERT(is_aligned_block<page_size>(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

View File

@@ -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<size_t>(PAGESIZE));
#else
static constexpr size_t page_size = Aal::smallest_page_size;
#endif