提交 f41cde31 编写于 作者: D dallas marlow

remove anon mmap allocation flag `MAP_HUGETLB`

上级 b5616daf
......@@ -83,8 +83,14 @@ char* Arena::AllocateAligned(size_t bytes, size_t huge_page_tlb_size,
size_t reserved_size =
((bytes - 1U) / huge_page_tlb_size + 1U) * huge_page_tlb_size;
assert(reserved_size >= bytes);
void* addr = mmap(nullptr, reserved_size, (PROT_READ | PROT_WRITE),
(MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB), 0, 0);
(MAP_PRIVATE | MAP_ANONYMOUS), 0, 0);
// only supported in kernel's 2.6.34 and above
// void* addr = mmap(nullptr, reserved_size, (PROT_READ | PROT_WRITE),
// (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB), 0, 0);
if (addr == MAP_FAILED) {
Warn(logger, "AllocateAligned fail to allocate huge TLB pages: %s",
strerror(errno));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册