File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 2121
2222struct provider_from_pool : public umf_test ::provider_base_t {
2323 umf_memory_pool_handle_t pool;
24+
25+ provider_from_pool () : pool(nullptr ) {}
26+
2427 umf_result_t initialize (const umf_memory_pool_t *_pool) noexcept {
2528 if (!_pool) {
2629 return UMF_RESULT_ERROR_INVALID_ARGUMENT;
@@ -29,14 +32,17 @@ struct provider_from_pool : public umf_test::provider_base_t {
2932 pool = (umf_memory_pool_handle_t )_pool;
3033 return UMF_RESULT_SUCCESS;
3134 }
35+
3236 umf_result_t alloc (size_t size, size_t align, void **ptr) noexcept {
3337 *ptr = umfPoolAlignedMalloc (pool, size, align);
3438 return (*ptr) ? UMF_RESULT_SUCCESS
3539 : UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY;
3640 }
41+
3742 umf_result_t free (void *ptr, size_t ) noexcept {
3843 return umfPoolFree (pool, ptr);
3944 }
45+
4046 umf_result_t get_name (const char **name) noexcept {
4147 *name = " provider_from_pool" ;
4248 return UMF_RESULT_SUCCESS;
You can’t perform that action at this time.
0 commit comments