awslabs / aws-c-common

Core c99 package for AWS SDK for C. Includes cross-platform primitives, configuration, data structures, and error handling.
Apache License 2.0
262 stars 159 forks source link

check if numa available or not before loading numa functions #1163

Closed TingDaoK closed 3 weeks ago

TingDaoK commented 3 weeks ago

Issue #, if available:

https://github.com/awslabs/aws-c-common/issues/1162

Description of changes:

Before any other calls in this library can be used numa_available() must be called. If it returns -1, all other functions in this library are undefined.

Referring to https://linux.die.net/man/3/numa_available. So, if numa_available() return -1, skip loading any other functions from libnuma.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

codecov-commenter commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 71.42857% with 4 lines in your changes missing coverage. Please review.

Project coverage is 83.60%. Comparing base (6f20cfb) to head (418bbea).

Files with missing lines Patch % Lines
source/common.c 71.42% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1163 +/- ## ========================================== - Coverage 83.61% 83.60% -0.02% ========================================== Files 57 57 Lines 5946 5948 +2 ========================================== + Hits 4972 4973 +1 - Misses 974 975 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.