Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/reusable_compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
run: >
UMF_LOG="level:warning;flush:debug;output:stderr;pid:no"
LD_LIBRARY_PATH=${{github.workspace}}/latest_version/build/lib/
ctest --output-on-failure
ctest --output-on-failure -E "umf-mempolicy" # disable tests that rely on internal structures

windows-build:
name: Windows
Expand Down
37 changes: 37 additions & 0 deletions include/umf/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,43 @@ typedef enum umf_result_t {
UMF_RESULT_ERROR_UNKNOWN = 0x7ffffffe ///< Unknown or internal error
} umf_result_t;

/// @brief Type of the CTL query
typedef enum umf_ctl_query_type {
CTL_QUERY_READ,
CTL_QUERY_WRITE,
CTL_QUERY_RUNNABLE,
CTL_QUERY_SUBTREE,

MAX_CTL_QUERY_TYPE
} umf_ctl_query_type_t;

///
/// @brief Get value of a specified attribute at the given name.
/// @param name name of an attribute to be retrieved
/// @param ctx pointer to the pool or the provider
/// @param arg [out] pointer to the variable where the value will be stored
/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure.
///
umf_result_t umfCtlGet(const char *name, void *ctx, void *arg);

///
/// @brief Set value of a specified attribute at the given name.
/// @param name name of an attribute to be set
/// @param ctx pointer to the pool or the provider
/// @param arg [in] pointer to the value that will be set
/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure.
///
umf_result_t umfCtlSet(const char *name, void *ctx, void *arg);

///
/// @brief Execute callback related with the specified attribute.
/// @param name name of an attribute to be executed
/// @param ctx pointer to the pool or the provider
/// @param arg [in/out] pointer to the value, can be used as an input or output
/// @return UMF_RESULT_SUCCESS on success or UMF_RESULT_ERROR_UNKNOWN on failure.
///
umf_result_t umfCtlExec(const char *name, void *ctx, void *arg);

#ifdef __cplusplus
}
#endif
Expand Down
16 changes: 16 additions & 0 deletions include/umf/memory_pool_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,22 @@ typedef struct umf_memory_pool_ops_t {
/// The value is undefined if the previous allocation was successful.
///
umf_result_t (*get_last_allocation_error)(void *pool);

///
/// @brief Control operation for the memory pool.
/// The function is used to perform various control operations
/// on the memory pool.
///
/// @param hPool handle to the memory pool.
/// @param operationType type of the operation to be performed.
/// @param name name associated with the operation.
/// @param arg argument for the operation.
/// @param queryType type of the query to be performed.
///
/// @return umf_result_t result of the control operation.
///
umf_result_t (*ctl)(void *hPool, int operationType, const char *name,
void *arg, umf_ctl_query_type_t queryType);
} umf_memory_pool_ops_t;

#ifdef __cplusplus
Expand Down
18 changes: 17 additions & 1 deletion include/umf/memory_provider_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ typedef struct umf_memory_provider_ext_ops_t {
///
umf_result_t (*allocation_split)(void *hProvider, void *ptr,
size_t totalSize, size_t firstSize);

} umf_memory_provider_ext_ops_t;

///
Expand Down Expand Up @@ -250,6 +249,23 @@ typedef struct umf_memory_provider_ops_t {
/// @brief Optional IPC ops. The API allows sharing of memory objects across different processes.
///
umf_memory_provider_ipc_ops_t ipc;

///
/// @brief Control operation for the memory provider.
/// The function is used to perform various control operations
/// on the memory provider.
///
/// @param hProvider handle to the memory provider.
/// @param operationType type of the operation to be performed.
/// @param name name associated with the operation.
/// @param arg argument for the operation.
/// @param queryType type of the query to be performed.
///
/// @return umf_result_t result of the control operation.
///
umf_result_t (*ctl)(void *hProvider, int operationType, const char *name,
void *arg, umf_ctl_query_type_t queryType);

} umf_memory_provider_ops_t;

#ifdef __cplusplus
Expand Down
Loading
Loading