Skip to content

Commit

Permalink
PAL::haiku finally supports getentropy. (#684)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
devnexen authored Oct 31, 2024
1 parent 97b7675 commit 43ad730
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
9 changes: 0 additions & 9 deletions src/snmalloc/pal/pal_haiku.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion src/snmalloc/pal/pal_posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 43ad730

Please sign in to comment.