diff --git a/include/umf/pools/pool_disjoint.h b/include/umf/pools/pool_disjoint.h index fdf682ae5b..be60083b12 100644 --- a/include/umf/pools/pool_disjoint.h +++ b/include/umf/pools/pool_disjoint.h @@ -52,6 +52,8 @@ umfDisjointPoolParamsDestroy(umf_disjoint_pool_params_handle_t hParams); umf_result_t umfDisjointPoolParamsSetSlabMinSize(umf_disjoint_pool_params_handle_t hParams, size_t slabMinSize); +size_t +umfDisjointPoolParamsGetSlabMinSize(umf_disjoint_pool_params_handle_t hParams); /// @brief Set size limit for allocations that are subject to pooling. /// @param hParams handle to the parameters of the disjoint pool. @@ -59,6 +61,8 @@ umfDisjointPoolParamsSetSlabMinSize(umf_disjoint_pool_params_handle_t hParams, /// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure. umf_result_t umfDisjointPoolParamsSetMaxPoolableSize( umf_disjoint_pool_params_handle_t hParams, size_t maxPoolableSize); +size_t +umfDisjointPoolParamsGetMaxPoolableSize(umf_disjoint_pool_params_handle_t hParams); /// @brief Set maximum capacity of each bucket. Each bucket will hold a /// max of \p maxCapacity unfreed slabs. @@ -68,6 +72,8 @@ umf_result_t umfDisjointPoolParamsSetMaxPoolableSize( umf_result_t umfDisjointPoolParamsSetCapacity(umf_disjoint_pool_params_handle_t hParams, size_t maxCapacity); +size_t +umfDisjointPoolParamsGetCapacity(umf_disjoint_pool_params_handle_t hParams); /// @brief Set minimum bucket allocation size. /// @param hParams handle to the parameters of the disjoint pool. @@ -76,6 +82,8 @@ umfDisjointPoolParamsSetCapacity(umf_disjoint_pool_params_handle_t hParams, umf_result_t umfDisjointPoolParamsSetMinBucketSize(umf_disjoint_pool_params_handle_t hParams, size_t minBucketSize); +size_t +umfDisjointPoolParamsGetMinBucketSize(umf_disjoint_pool_params_handle_t hParams); /// @brief Set trace level for pool usage statistics. /// @param hParams handle to the parameters of the disjoint pool. @@ -84,6 +92,7 @@ umfDisjointPoolParamsSetMinBucketSize(umf_disjoint_pool_params_handle_t hParams, umf_result_t umfDisjointPoolParamsSetTrace(umf_disjoint_pool_params_handle_t hParams, int poolTrace); +int umfDisjointPoolParamsGetTrace(umf_disjoint_pool_params_handle_t hParams); /// @brief Set shared limits for disjoint pool. /// @param hParams handle to the parameters of the disjoint pool. @@ -93,6 +102,9 @@ umf_result_t umfDisjointPoolParamsSetSharedLimits( umf_disjoint_pool_params_handle_t hParams, umf_disjoint_pool_shared_limits_handle_t hSharedLimits); +umf_disjoint_pool_shared_limits_handle_t +umfDisjointPoolParamsGetSharedLimits(umf_disjoint_pool_params_handle_t hParams); + /// @brief Set custom name of the disjoint pool to be used in the traces. /// @param hParams handle to the parameters of the disjoint pool. /// @param name custom name of the pool. @@ -101,6 +113,9 @@ umf_result_t umfDisjointPoolParamsSetName(umf_disjoint_pool_params_handle_t hParams, const char *name); +const char * +umfDisjointPoolParamsGetName(umf_disjoint_pool_params_handle_t hParams); + umf_memory_pool_ops_t *umfDisjointPoolOps(void); #ifdef __cplusplus diff --git a/src/pool/pool_disjoint.cpp b/src/pool/pool_disjoint.cpp index e0298b43df..526bdc3332 100644 --- a/src/pool/pool_disjoint.cpp +++ b/src/pool/pool_disjoint.cpp @@ -177,6 +177,12 @@ umfDisjointPoolParamsSetSlabMinSize(umf_disjoint_pool_params_handle_t hParams, return UMF_RESULT_SUCCESS; } +size_t +umfDisjointPoolParamsGetSlabMinSize(umf_disjoint_pool_params_handle_t hParams) +{ + return hParams->SlabMinSize; +} + umf_result_t umfDisjointPoolParamsSetMaxPoolableSize( umf_disjoint_pool_params_handle_t hParams, size_t maxPoolableSize) { if (!hParams) { @@ -188,6 +194,12 @@ umf_result_t umfDisjointPoolParamsSetMaxPoolableSize( return UMF_RESULT_SUCCESS; } +size_t +umfDisjointPoolParamsGetMaxPoolableSize(umf_disjoint_pool_params_handle_t hParams) { + return hParams->MaxPoolableSize; +} + + umf_result_t umfDisjointPoolParamsSetCapacity(umf_disjoint_pool_params_handle_t hParams, size_t maxCapacity) { @@ -200,6 +212,11 @@ umfDisjointPoolParamsSetCapacity(umf_disjoint_pool_params_handle_t hParams, return UMF_RESULT_SUCCESS; } +size_t +umfDisjointPoolParamsGetCapacity(umf_disjoint_pool_params_handle_t hParams) { + return hParams->Capacity; +} + umf_result_t umfDisjointPoolParamsSetMinBucketSize(umf_disjoint_pool_params_handle_t hParams, size_t minBucketSize) { @@ -218,6 +235,11 @@ umfDisjointPoolParamsSetMinBucketSize(umf_disjoint_pool_params_handle_t hParams, return UMF_RESULT_SUCCESS; } +size_t +umfDisjointPoolParamsGetMinBucketSize(umf_disjoint_pool_params_handle_t hParams) { + return hParams->MinBucketSize; +} + umf_result_t umfDisjointPoolParamsSetTrace(umf_disjoint_pool_params_handle_t hParams, int poolTrace) { @@ -230,6 +252,10 @@ umfDisjointPoolParamsSetTrace(umf_disjoint_pool_params_handle_t hParams, return UMF_RESULT_SUCCESS; } +int umfDisjointPoolParamsGetTrace(umf_disjoint_pool_params_handle_t hParams){ + return hParams->PoolTrace; +} + umf_result_t umfDisjointPoolParamsSetSharedLimits( umf_disjoint_pool_params_handle_t hParams, umf_disjoint_pool_shared_limits_handle_t hSharedLimits) { @@ -242,6 +268,11 @@ umf_result_t umfDisjointPoolParamsSetSharedLimits( return UMF_RESULT_SUCCESS; } +umf_disjoint_pool_shared_limits_handle_t +umfDisjointPoolParamsGetSharedLimits(umf_disjoint_pool_params_handle_t hParams) { + return hParams->SharedLimits; +} + umf_result_t umfDisjointPoolParamsSetName(umf_disjoint_pool_params_handle_t hParams, const char *name) { @@ -263,6 +294,12 @@ umfDisjointPoolParamsSetName(umf_disjoint_pool_params_handle_t hParams, return UMF_RESULT_SUCCESS; } +const char * +umfDisjointPoolParamsGetName(umf_disjoint_pool_params_handle_t hParams) { + return hParams->Name; +} + + // Allocations are a minimum of 4KB/64KB/2MB even when a smaller size is // requested. The implementation distinguishes between allocations of size // ChunkCutOff = (minimum-alloc-size / 2) and those that are larger.