-
Notifications
You must be signed in to change notification settings - Fork 35
Add tests for alignment in OS memory provider #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tests for alignment in OS memory provider #93
Conversation
1424c1e
to
c425f01
Compare
Add tests for alignment in OS memory provider and refactor tests to use gtest's |
c425f01
to
9d818ee
Compare
test/provider_os_memory.cpp
Outdated
// wrong NUMA flags | ||
os_memory_provider_params.numa_flags = (unsigned int)-1; | ||
// capture provider and destroy it | ||
auto providerDestructor = [](umf_memory_provider_handle_t hProvider) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you don't need to create a custom destructor here, you can just pass umfMemoryProviderDestroy
directly to unique_ptr ctor, like this: return umf::provider_unique_handle_t(hProvider, &umfMemoryProviderDestroy);
This was needed for poolCreateExt because we wanted to destroy both pool and provider at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
test/provider_os_memory.cpp
Outdated
ASSERT_EQ(umf_result, UMF_RESULT_SUCCESS); | ||
ASSERT_NE(os_memory_provider, nullptr); | ||
ASSERT_LE(min_page_size, SIZE_4100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why compare with 4100? Should we even have a hardcoded page size here? There can be some systems with different page sizes right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@igchor review again, please |
a8813e9
to
b0552b8
Compare
Add tests for alignment in OS memory provider and refactor tests to use gtest's TEST_P(). Signed-off-by: Lukasz Dorau <[email protected]>
b0552b8
to
d611e28
Compare
Add tests for alignment in OS memory provider and refactor tests to use gtest's
TEST_P()
.