Skip to content

Commit e73c49e

Browse files
authored
Merge pull request #1290 from lukaszstolarczuk/no-assert
Remove redundant asserts in umfMemspace*Init
2 parents 4dc9df9 + 2fb62b1 commit e73c49e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/memspaces/memspace_highest_bandwidth.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ static void umfMemspaceHighestBandwidthInit(void) {
105105
LOG_DEBUG(
106106
"Creating the highest bandwidth memspace failed with the error: %u",
107107
ret);
108-
assert(ret == UMF_RESULT_ERROR_NOT_SUPPORTED);
108+
if (ret != UMF_RESULT_ERROR_NOT_SUPPORTED) {
109+
LOG_FATAL("Unknown error, expected "
110+
"'UMF_RESULT_ERROR_NOT_SUPPORTED', got: %u",
111+
ret);
112+
}
109113
}
110114
}
111115

src/memspaces/memspace_lowest_latency.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ static void umfMemspaceLowestLatencyInit(void) {
101101
LOG_DEBUG(
102102
"Creating the lowest latency memspace failed with the error: %u",
103103
ret);
104-
assert(ret == UMF_RESULT_ERROR_NOT_SUPPORTED);
104+
if (ret != UMF_RESULT_ERROR_NOT_SUPPORTED) {
105+
LOG_FATAL("Unknown error, expected "
106+
"'UMF_RESULT_ERROR_NOT_SUPPORTED', got: %u",
107+
ret);
108+
}
105109
}
106110

107111
#if defined(_WIN32) && !defined(UMF_SHARED_LIBRARY)

0 commit comments

Comments
 (0)