mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 04:13:28 +01:00
equix: Add NetBSD to "huge pages not supported" path
As suggested by @wiz on #40843, let's add an explicit check to hashx_vm_alloc_huge() that avoids using a Linux-style default on NetBSD targets. This doesn't change the questionable Linux-style default, but a future patch will disable this code by default so it's not a portability liability. (This code is in hashx's VM layer but it's actually only relevant to equix.) This addresses bug #40843. Another patch will disable huge pages by default entirely, but this patch is sufficient to fix the NetBSD build.
This commit is contained in:
parent
4119a7f971
commit
9cac0a85b4
@ -106,8 +106,8 @@ void* hashx_vm_alloc_huge(size_t bytes) {
|
|||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__)
|
||||||
mem = mmap(NULL, bytes, PAGE_READWRITE, MAP_PRIVATE | MAP_ANONYMOUS
|
mem = mmap(NULL, bytes, PAGE_READWRITE, MAP_PRIVATE | MAP_ANONYMOUS
|
||||||
| MAP_ALIGNED_SUPER, -1, 0);
|
| MAP_ALIGNED_SUPER, -1, 0);
|
||||||
#elif defined(__OpenBSD__)
|
#elif defined(__OpenBSD__) || defined(__NetBSD__)
|
||||||
mem = MAP_FAILED; // OpenBSD does not support huge pages
|
mem = MAP_FAILED; // OpenBSD and NetBSD do not support huge pages
|
||||||
#else
|
#else
|
||||||
mem = mmap(NULL, bytes, PAGE_READWRITE, MAP_PRIVATE | MAP_ANONYMOUS
|
mem = mmap(NULL, bytes, PAGE_READWRITE, MAP_PRIVATE | MAP_ANONYMOUS
|
||||||
| MAP_HUGETLB | MAP_POPULATE, -1, 0);
|
| MAP_HUGETLB | MAP_POPULATE, -1, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user