提交 9d6503f8 编写于 作者: S sdong

Fix arena_test test break using glibc-2.17

Summary: arena_test is failing with glibc-2.17. Make it more robust

Test Plan: Run arena_test using both of glibc-2.17 and 2.2 and make sure both passes.

Reviewers: yhchiang, rven, IslamAbdelRahman, kradhakrishnan, igor

Reviewed By: igor

Subscribers: leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D45879
上级 77a28615
......@@ -58,21 +58,15 @@ void MemoryAllocatedBytesTest(size_t huge_page_size) {
ASSERT_EQ(arena.MemoryAllocatedBytes(), expected_memory_allocated);
}
// requested size > quarter of a block:
// requested size > size of a block:
// allocate requested size separately
req_sz = 999 * 4096;
expected_memory_allocated = arena.MemoryAllocatedBytes();
req_sz = 8 * 1024 * 1024;
for (int i = 0; i < N; i++) {
arena.Allocate(req_sz);
}
expected_memory_allocated += req_sz * N;
if (huge_page_size) {
ASSERT_TRUE(arena.MemoryAllocatedBytes() ==
expected_memory_allocated + bsz ||
arena.MemoryAllocatedBytes() ==
expected_memory_allocated + huge_page_size);
} else {
ASSERT_EQ(arena.MemoryAllocatedBytes(), expected_memory_allocated);
}
ASSERT_EQ(arena.MemoryAllocatedBytes(), expected_memory_allocated);
}
// Make sure we didn't count the allocate but not used memory space in
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册