Skip to content

Commit

Permalink
Haiku build fix post refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed May 25, 2022
1 parent 7ff10c3 commit 5b00261
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/snmalloc/pal/pal_haiku.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ 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
Expand All @@ -37,6 +38,16 @@ 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

0 comments on commit 5b00261

Please sign in to comment.