Skip to content

unify return values for destroy functions #1356

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lplewa
Copy link
Contributor

@lplewa lplewa commented Jun 5, 2025

fixes: #1217

Description

Checklist

  • Code compiles without errors locally
  • All tests pass locally
  • CI workflows execute properly
  • CI workflows, not executed per PR (e.g. Nightly), execute properly
  • New tests added, especially if they will fail without my changes
  • Added/extended example(s) to cover this functionality
  • Extended the README/documentation
  • All newly added source files have a license
  • All newly added source files are referenced in CMake files
  • Logger (with debug/info/... messages) is used
  • All API changes are reflected in docs and def/map files, and are tested

@lplewa lplewa requested a review from a team as a code owner June 5, 2025 12:11
@lplewa lplewa force-pushed the unify branch 4 times, most recently from 5d2f404 to 941f998 Compare June 10, 2025 09:19
Copy link
Contributor

@lukaszstolarczuk lukaszstolarczuk left a comment

Choose a reason for hiding this comment

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

pls remember to open a draft PR in SYCL repo to update UMF usage there; can be done now or after the merge

@@ -48,7 +48,7 @@ typedef struct umf_memory_pool_ops_t {
/// @brief Finalizes memory pool
/// @param pool pool to finalize
///
Copy link
Contributor

Choose a reason for hiding this comment

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

missing @return..?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -43,7 +43,7 @@ typedef struct umf_memory_provider_ops_t {
/// @brief Finalizes memory provider.
/// @param provider provider to finalize
///
Copy link
Contributor

Choose a reason for hiding this comment

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

missing @return..?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -48,8 +48,11 @@ void test_disjoint_pool_shared_limits(void) {

umfPoolDestroy(pool);
umfMemoryProviderDestroy(provider);
Copy link
Contributor

Choose a reason for hiding this comment

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

soo... should we add a return value check in all tests for all destroy calls...?
// I can see you added in some/most tests, but not in all of them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Too much work, and almost zero gain to add it everywhere - i added few asserts for all changes function to ensure that return value is correct.

}

if (!hProvider) {
return UMF_RESULT_SUCCESS;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we might be missing a test for that case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unify return values for Destroy functions
4 participants