Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions test/provider_devdax_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ TEST_P(umfProviderTest, purge_force) {
test_alloc_free_success(provider.get(), page_size, 0, PURGE_FORCE);
}

TEST_P(umfProviderTest, purge_force_unalligned_alloc) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unalligned -> unaligned

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it that devdax malloc is always aligned?

if (IS_NOT_ALIGNED(alignment, DEVDAX_PAGE_SIZE_2MB)) {
alignment = ALIGN_UP(alignment, DEVDAX_PAGE_SIZE_2MB);
}

void *ptr;
auto ret = umfMemoryProviderAlloc(provider.get(), page_size / 2, 0, &ptr);
ASSERT_EQ(ret, UMF_RESULT_SUCCESS);
test_alloc_free_success(provider.get(), page_size, 0, PURGE_FORCE);
umfMemoryProviderFree(provider.get(), ptr, page_size / 2);
}
// negative tests using test_alloc_failure

TEST_P(umfProviderTest, alloc_page64_align_page_minus_1_WRONG_ALIGNMENT_1) {
Expand Down
Loading