Skip to content

Ctl by name #1471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions .github/workflows/reusable_compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,12 @@ jobs:

- name: Run "tag" UMF tests with latest UMF libs (warnings enabled)
working-directory: ${{github.workspace}}/tag_version/build
run: >
UMF_LOG="level:warning;flush:debug;output:stderr;pid:no"
LD_LIBRARY_PATH=${{github.workspace}}/latest_version/build/lib/
ctest --verbose
env:
UMF_LOG: level:warning;flush:debug;output:stderr;pid:no
LD_LIBRARY_PATH: ${{github.workspace}}/latest_version/build/lib/
run: |
ctest --verbose -E test_memoryProvider
test/test_memoryProvider --gtest_filter="-*Trace"

# Browse all folders in the examples directory, build them using the
# latest UMF version, and run them, excluding those in the exclude list.
Expand Down Expand Up @@ -220,10 +222,11 @@ jobs:

- name: Run "tag" UMF tests with latest UMF libs (warnings enabled)
working-directory: ${{github.workspace}}/tag_version/build
env:
UMF_LOG: level:warning;flush:debug;output:stderr;pid:no
run: |
$env:UMF_LOG="level:warning;flush:debug;output:stderr;pid:no"
cp ${{github.workspace}}/latest_version/build/bin/Debug/umf.dll ${{github.workspace}}/tag_version/build/bin/Debug/umf.dll
ctest -C Debug --verbose
ctest -C Debug --verbose -E test_memoryProvider

# Browse all folders in the examples directory, build them using the
# latest UMF version, and run them, excluding those in the exclude list.
Expand Down Expand Up @@ -361,10 +364,12 @@ jobs:

- name: Run "tag" UMF tests with latest UMF libs (warnings enabled)
working-directory: ${{github.workspace}}/tag_version/build
run: >
UMF_LOG="level:warning;flush:debug;output:stderr;pid:no"
LD_LIBRARY_PATH=${{github.workspace}}/latest_version/build/lib/
ctest --verbose
env:
UMF_LOG: level:warning;flush:debug;output:stderr;pid:no
LD_LIBRARY_PATH: ${{github.workspace}}/latest_version/build/lib/
run: |
ctest --verbose -E test_memoryProvider
test/test_memoryProvider --gtest_filter="-*Trace"

# Browse all folders in the examples directory, build them using the
# latest UMF version, and run them, excluding those in the exclude list.
Expand Down
3 changes: 2 additions & 1 deletion docs/config/spelling_exceptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@ umfPoolMallocUsableSize
umfPoolRealloc
umfMemspaceUserFilter
umfMemspaceMemtargetAdd
unfreed
unfreed
zA
7 changes: 6 additions & 1 deletion include/umf/memory_pool_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,13 @@ typedef struct umf_memory_pool_ops_t {
///
/// * Implementations *must* return default pool name when NULL is provided,
/// otherwise the pool's name is returned.
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
///
/// * The returned name should not exceed 64 characters including null character and may contain
/// only [a-zA-Z0-9_-] characters. Names violating these rules are deprecated
/// and will not be supported in the next major API release.
/// CTL functionality may be limited if other characters are returned.
///
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
umf_result_t (*get_name)(void *pool, const char **name);

///
Expand Down
12 changes: 11 additions & 1 deletion include/umf/memory_provider_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,18 @@ typedef struct umf_memory_provider_ops_t {
/// @brief Retrieve name of a given memory \p provider.
/// @param provider pointer to the memory provider
/// @param name [out] pointer to a string containing the name of the \p provider
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
/// \details
/// * Implementations *must* return a literal null-terminated string.
///
/// * Implementations *must* return default pool name when NULL is provided,
/// otherwise the pool's name is returned.
///
/// * The returned name should not exceed 64 characters and may contain
/// only [a-zA-Z0-9_-] characters. Names violating these rules are deprecated
/// and will not be supported in the next major API release.
/// CTL functionality may be limited if other characters are returned.
///
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
umf_result_t (*get_name)(void *provider, const char **name);

///
Expand Down
2 changes: 2 additions & 0 deletions include/umf/pools/pool_disjoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ umf_result_t umfDisjointPoolParamsSetSharedLimits(
/// @param hParams handle to the parameters of the disjoint pool.
/// @param name custom name of the pool. Must not be NULL. Name longer than 63
/// characters will be truncated.
/// \details Name should contain only [a-zA-Z0-9_-] characters.
/// Other names are deprecated and may limit CTL functionality.
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
umf_result_t
umfDisjointPoolParamsSetName(umf_disjoint_pool_params_handle_t hParams,
Expand Down
2 changes: 2 additions & 0 deletions include/umf/pools/pool_jemalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ umfJemallocPoolParamsSetNumArenas(umf_jemalloc_pool_params_handle_t hParams,
/// @param hParams handle to the parameters of the jemalloc pool.
/// @param name custom name. Must not be NULL. Name longer than 63 characters
/// will be truncated.
/// \details Name should contain only [a-zA-Z0-9_-] characters.
/// Other names are deprecated and may limit CTL functionality.
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
umf_result_t
umfJemallocPoolParamsSetName(umf_jemalloc_pool_params_handle_t hParams,
Expand Down
2 changes: 2 additions & 0 deletions include/umf/pools/pool_scalable.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ umfScalablePoolParamsSetKeepAllMemory(umf_scalable_pool_params_handle_t hParams,
/// @param hParams handle to the parameters of the scalable pool.
/// @param name custom name. Must not be NULL. Name longer than 63 characters
/// will be truncated.
/// \details Name should contain only [a-zA-Z0-9_-] characters.
/// Other names are deprecated and may limit CTL functionality.
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
umf_result_t
umfScalablePoolParamsSetName(umf_scalable_pool_params_handle_t hParams,
Expand Down
2 changes: 2 additions & 0 deletions include/umf/providers/provider_cuda.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ umf_result_t umfCUDAMemoryProviderParamsSetAllocFlags(
/// @param hParams handle to the parameters of the CUDA Memory Provider.
/// @param name custom name. Must not be NULL. Name longer than 63 characters
/// will be truncated.
/// \details Name should contain only [a-zA-Z0-9_-] characters.
/// Other names are deprecated and may limit CTL functionality.
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
umf_result_t umfCUDAMemoryProviderParamsSetName(
umf_cuda_memory_provider_params_handle_t hParams, const char *name);
Expand Down
2 changes: 2 additions & 0 deletions include/umf/providers/provider_devdax_memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ umf_result_t umfDevDaxMemoryProviderParamsSetProtection(
/// @param hParams [in] handle to the parameters of the Devdax Memory Provider.
/// @param name [in] custom name. Must not be NULL. Name longer than 63 characters
/// will be truncated.
/// \details Name should contain only [a-zA-Z0-9_-] characters.
/// Other names are deprecated and may limit CTL functionality.
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
umf_result_t umfDevDaxMemoryProviderParamsSetName(
umf_devdax_memory_provider_params_handle_t hParams, const char *name);
Expand Down
2 changes: 2 additions & 0 deletions include/umf/providers/provider_file_memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ const umf_memory_provider_ops_t *umfFileMemoryProviderOps(void);
/// @param hParams handle to the parameters of the File Memory Provider.
/// @param name custom name. Must not be NULL. Name longer than 63 characters
/// will be truncated.
/// \details Name should contain only [a-zA-Z0-9_-] characters.
/// Other names are deprecated and may limit CTL functionality.
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
umf_result_t umfFileMemoryProviderParamsSetName(
umf_file_memory_provider_params_handle_t hParams, const char *name);
Expand Down
2 changes: 2 additions & 0 deletions include/umf/providers/provider_fixed_memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ const umf_memory_provider_ops_t *umfFixedMemoryProviderOps(void);
/// @param hParams [in] handle to the parameters of the Fixed Memory Provider.
/// @param name [in] custom name. Must not be NULL. Name longer than 63 characters
/// will be truncated.
/// \details Name should contain only [a-zA-Z0-9_-] characters.
/// Other names are deprecated and may limit CTL functionality.
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
umf_result_t umfFixedMemoryProviderParamsSetName(
umf_fixed_memory_provider_params_handle_t hParams, const char *name);
Expand Down
2 changes: 2 additions & 0 deletions include/umf/providers/provider_level_zero.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ umf_result_t umfLevelZeroMemoryProviderParamsSetDeviceOrdinal(
/// @param hParams handle to the parameters of the Level Zero Memory Provider.
/// @param name custom name. Must not be NULL. Name longer than 63 characters
/// will be truncated.
/// \details Name should contain only [a-zA-Z0-9_-] characters.
/// Other names are deprecated and may limit CTL functionality.
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
umf_result_t umfLevelZeroMemoryProviderParamsSetName(
umf_level_zero_memory_provider_params_handle_t hParams, const char *name);
Expand Down
2 changes: 2 additions & 0 deletions include/umf/providers/provider_os_memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ umf_result_t umfOsMemoryProviderParamsSetPartitions(
/// @param hParams handle to the parameters of the OS memory provider.
/// @param name custom name. Must not be NULL. Name longer than 63 characters
/// will be truncated.
/// \details Name should contain only [a-zA-Z0-9_-] characters.
/// Other names are deprecated and may limit CTL functionality.
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure.
umf_result_t
umfOsMemoryProviderParamsSetName(umf_os_memory_provider_params_handle_t hParams,
Expand Down
16 changes: 16 additions & 0 deletions src/base_alloc/base_alloc_global.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,19 @@ size_t umf_ba_global_malloc_usable_size(const void *ptr) {

return usable_size;
}

char *umf_ba_global_strdup(const char *s) {
if (!s) {
return NULL;
}

size_t len = strlen(s);

char *ptr = umf_ba_global_alloc(len + 1);
if (!ptr) {
return NULL;
}

memcpy(ptr, s, len + 1);
return ptr;
}
1 change: 1 addition & 0 deletions src/base_alloc/base_alloc_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ void umf_ba_destroy_global(void);
bool umf_ba_global_is_destroyed(void);
size_t umf_ba_global_malloc_usable_size(const void *ptr);
void *umf_ba_global_aligned_alloc(size_t size, size_t alignment);
char *umf_ba_global_strdup(const char *s);

#ifdef __cplusplus
}
Expand Down
Loading