diff --git a/src/pool/pool_scalable.c b/src/pool/pool_scalable.c index 8e92d87587..7f355161cb 100644 --- a/src/pool/pool_scalable.c +++ b/src/pool/pool_scalable.c @@ -174,8 +174,8 @@ static void tbb_raw_free_wrapper(intptr_t pool_id, void *ptr, size_t bytes) { } umf_result_t -umfScalablePoolParamsCreate(umf_scalable_pool_params_handle_t *params) { - if (!params) { +umfScalablePoolParamsCreate(umf_scalable_pool_params_handle_t *hParams) { + if (!hParams) { LOG_ERR("scalable pool params handle is NULL"); return UMF_RESULT_ERROR_INVALID_ARGUMENT; } @@ -190,28 +190,28 @@ umfScalablePoolParamsCreate(umf_scalable_pool_params_handle_t *params) { params_data->granularity = DEFAULT_GRANULARITY; params_data->keep_all_memory = false; - *params = (umf_scalable_pool_params_handle_t)params_data; + *hParams = (umf_scalable_pool_params_handle_t)params_data; return UMF_RESULT_SUCCESS; } umf_result_t -umfScalablePoolParamsDestroy(umf_scalable_pool_params_handle_t params) { - if (!params) { - LOG_ERR("params is NULL"); +umfScalablePoolParamsDestroy(umf_scalable_pool_params_handle_t hParams) { + if (!hParams) { + LOG_ERR("scalable pool params handle is NULL"); return UMF_RESULT_ERROR_INVALID_ARGUMENT; } - umf_ba_global_free(params); + umf_ba_global_free(hParams); return UMF_RESULT_SUCCESS; } umf_result_t -umfScalablePoolParamsSetGranularity(umf_scalable_pool_params_handle_t params, +umfScalablePoolParamsSetGranularity(umf_scalable_pool_params_handle_t hParams, size_t granularity) { - if (!params) { - LOG_ERR("params is NULL"); + if (!hParams) { + LOG_ERR("scalable pool params handle is NULL"); return UMF_RESULT_ERROR_INVALID_ARGUMENT; } @@ -220,20 +220,20 @@ umfScalablePoolParamsSetGranularity(umf_scalable_pool_params_handle_t params, return UMF_RESULT_ERROR_INVALID_ARGUMENT; } - params->granularity = granularity; + hParams->granularity = granularity; return UMF_RESULT_SUCCESS; } umf_result_t -umfScalablePoolParamsSetKeepAllMemory(umf_scalable_pool_params_handle_t params, - bool keep_all_memory) { - if (!params) { - LOG_ERR("params is NULL"); +umfScalablePoolParamsSetKeepAllMemory(umf_scalable_pool_params_handle_t hParams, + bool keepAllMemory) { + if (!hParams) { + LOG_ERR("scalable pool params handle is NULL"); return UMF_RESULT_ERROR_INVALID_ARGUMENT; } - params->keep_all_memory = keep_all_memory; + hParams->keep_all_memory = keepAllMemory; return UMF_RESULT_SUCCESS; } diff --git a/test/pools/scalable_pool.cpp b/test/pools/scalable_pool.cpp index 68409b4bba..0066f75e33 100644 --- a/test/pools/scalable_pool.cpp +++ b/test/pools/scalable_pool.cpp @@ -29,16 +29,16 @@ struct umfScalablePoolParamsTest struct provider_validator : public umf_test::provider_ba_global { using base_provider = umf_test::provider_ba_global; - umf_result_t initialize(validation_params_t *params) noexcept { + umf_result_t initialize(validation_params_t *params) { EXPECT_NE(params, nullptr); expected_params = params; return UMF_RESULT_SUCCESS; } - umf_result_t alloc(size_t size, size_t align, void **ptr) noexcept { + umf_result_t alloc(size_t size, size_t align, void **ptr) { EXPECT_EQ(size, expected_params->granularity); return base_provider::alloc(size, align, ptr); } - umf_result_t free(void *ptr, size_t size) noexcept { + umf_result_t free(void *ptr, size_t size) { EXPECT_EQ(expected_params->keep_all_memory, false); return base_provider::free(ptr, size); } @@ -49,7 +49,7 @@ struct umfScalablePoolParamsTest static constexpr umf_memory_provider_ops_t VALIDATOR_PROVIDER_OPS = umf::providerMakeCOps(); - umfScalablePoolParamsTest() {} + umfScalablePoolParamsTest() : expected_params{0, false}, params(nullptr) {} void SetUp() override { test::SetUp(); auto [granularity, keep_all_memory] = this->GetParam();