Skip to content
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

Split UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY into Distinct Error Codes #968

Open
lplewa opened this issue Dec 5, 2024 · 0 comments
Open

Split UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY into Distinct Error Codes #968

lplewa opened this issue Dec 5, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@lplewa
Copy link
Contributor

lplewa commented Dec 5, 2024

Description:

Currently, the umf_result_t enumeration includes an error code UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY that is used in two distinct scenarios within the UMF library:

  1. When the UMF library fails to allocate host memory for its internal metadata structures.
  2. When a memory provider fails to allocate memory because it has exhausted its available memory resources.

Using the same error code for both situations can make it difficult for developers to accurately diagnose and handle errors, as the root causes might be different (especially for providers like: gpu, dax etc...).


Proposal:

Split UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY into two separate error codes:

  1. UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY: Retain this error code to exclusively represent failures in allocating host memory for UMF's internal metadata and operations.

  2. UMF_RESULT_ERROR_MEMORY_PROVIDER_OUT_OF_MEMORY: Introduce this new error code to indicate that a memory provider has run out of memory and cannot fulfill the allocation request.


@lplewa lplewa added the enhancement New feature or request label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant