Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Dallas Marlow authored and Dallas Marlow committed May 9, 2014
1 parent deb8940 commit 030db3d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions util/arena.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,16 @@ char* Arena::AllocateAligned(size_t bytes, size_t huge_page_tlb_size,
assert((kAlignUnit & (kAlignUnit - 1)) ==
0); // Pointer size should be a power of 2

#ifdef OS_LINUX
#ifdef MAP_HUGETLB
if (huge_page_tlb_size > 0 && bytes > 0) {
// Allocate from a huge page TBL table.
assert(logger != nullptr); // logger need to be passed in.
size_t reserved_size =
((bytes - 1U) / huge_page_tlb_size + 1U) * huge_page_tlb_size;
assert(reserved_size >= bytes);

#ifdef MAP_HUGETLB
void* addr = mmap(nullptr, reserved_size, (PROT_READ | PROT_WRITE),
(MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB), 0, 0);
#else
void* addr = mmap(nullptr, reserved_size, (PROT_READ | PROT_WRITE),
(MAP_PRIVATE | MAP_ANONYMOUS), 0, 0);
#endif

if (addr == MAP_FAILED) {
Warn(logger, "AllocateAligned fail to allocate huge TLB pages: %s",
Expand Down

0 comments on commit 030db3d

Please sign in to comment.