2020#include "base_alloc_global.h"
2121#include "coarse.h"
2222#include "libumf.h"
23+ #include "memory_pool_internal.h"
2324#include "utils_common.h"
2425#include "utils_concurrency.h"
2526#include "utils_log.h"
@@ -34,6 +35,8 @@ typedef struct fixed_memory_provider_t {
3435
3536 // used only when the UMF_FIXED_FLAG_CREATE_FROM_POOL_PTR flag is set
3637 size_t ptr_orig_size ; // original size of the memory region in the tracker
38+ umf_memory_provider_handle_t
39+ trackingProvider ; // tracking provider of the original memory pool
3740} fixed_memory_provider_t ;
3841
3942// Fixed Memory provider settings struct
@@ -89,6 +92,7 @@ static umf_result_t fixed_allocation_merge_cb(void *provider, void *lowPtr,
8992static umf_result_t fixed_initialize (void * params , void * * provider ) {
9093 umf_result_t ret ;
9194 size_t ptr_orig_size = 0 ;
95+ umf_memory_provider_handle_t trackingProvider = NULL ;
9296
9397 if (params == NULL ) {
9498 return UMF_RESULT_ERROR_INVALID_ARGUMENT ;
@@ -104,6 +108,12 @@ static umf_result_t fixed_initialize(void *params, void **provider) {
104108 "the given pointer does not belong to any UMF pool" );
105109 return UMF_RESULT_ERROR_INVALID_ARGUMENT ;
106110 }
111+
112+ ret = umfPoolGetTrackingProvider (pool , & trackingProvider );
113+ if (ret != UMF_RESULT_SUCCESS ) {
114+ LOG_ERR ("cannot get the tracking provider of the pool %p" , pool );
115+ return ret ;
116+ }
107117 }
108118
109119 fixed_memory_provider_t * fixed_provider =
@@ -139,6 +149,7 @@ static umf_result_t fixed_initialize(void *params, void **provider) {
139149 fixed_provider -> size = in_params -> size ;
140150 fixed_provider -> flags = in_params -> flags ;
141151 fixed_provider -> ptr_orig_size = ptr_orig_size ;
152+ fixed_provider -> trackingProvider = trackingProvider ;
142153
143154 // add the entire memory as a single block
144155 ret = coarse_add_memory_fixed (coarse , fixed_provider -> base ,
0 commit comments