Haiku build fix post refactoring.

This commit is contained in:
David Carlier
2022-05-25 21:08:21 +00:00
committed by Matthew Parkinson
parent 7ff10c30f1
commit 1b8aa6bc0d

View File

@@ -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<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