Skip to content

Commit 8ae76f4

Browse files
authored
Merge pull request #1540 from bratpiorka/rrudnick_fix_post_init
do not call post_initialize on provider < 1.1
2 parents ee59e5a + b273986 commit 8ae76f4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/memory_provider.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,17 @@ void assignOpsIpcDefaults(umf_memory_provider_ops_t *ops) {
230230

231231
static umf_result_t umfProviderPostInitialize(umf_memory_provider_ops_t *ops,
232232
void *provider_priv, ...) {
233+
234+
// "post_initialize" ctl query is supported since version 1.1
235+
if (ops->version < UMF_MAKE_VERSION(1, 1)) {
236+
LOG_DEBUG(
237+
"\"post_initialize\" ctl query was not required for memory "
238+
"provider version %d, but the implementation could not handle "
239+
"errors properly in this case",
240+
ops->version);
241+
return UMF_RESULT_ERROR_INVALID_CTL_PATH;
242+
}
243+
233244
va_list args;
234245
va_start(args, provider_priv);
235246
umf_result_t ret =

0 commit comments

Comments
 (0)