Skip to content

Commit 467c5bb

Browse files
committed
[UTest] Fix unit test assuming 4 KiB page size.
Fix the unit test of of `list_allocator`, which was incorrectly assuming 4 KiB pages. However, on macOS M1 (ARM architecture), we do have 16 KiB pages. This fix adapts the pre-allocation to compute the amount of memory based on the system's actual pagesize.
1 parent ad2e3be commit 467c5bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

unittest/util/AllocatorTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ TEST_CASE("list_allocator", "[core][util][allocator]")
272272
SECTION("across pages, within allocations")
273273
{
274274
const auto pagesize = get_pagesize();
275-
list_allocator B(64 * 1024);
275+
list_allocator B(16 * pagesize);
276276
CHECK(B.num_chunks_available() == 1); // pre-allocation
277277

278278
auto *p0 = B.allocate(2 * pagesize);

0 commit comments

Comments
 (0)