-
Notifications
You must be signed in to change notification settings - Fork 37
add memory properties API #1301
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* | ||
* Copyright (C) 2025 Intel Corporation | ||
* | ||
* Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT. | ||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
* | ||
*/ | ||
|
||
#ifndef UMF_MEMORY_PROPS_H | ||
#define UMF_MEMORY_PROPS_H 1 | ||
|
||
#include <umf/base.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/// @brief Get the memory properties handle for a given pointer | ||
/// \details | ||
/// The handle returned by this function is valid until the memory pointed | ||
/// to by the pointer is freed. | ||
/// @param ptr pointer to the allocated memory | ||
/// @param props_handle [out] pointer to the memory properties handle | ||
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure | ||
umf_result_t | ||
umfGetMemoryPropertiesHandle(const void *ptr, | ||
umf_memory_properties_handle_t *props_handle); | ||
|
||
/// @brief Get a specific memory property from the properties handle | ||
/// @param props_handle handle to the memory properties | ||
/// @param memory_property_id ID of the memory property to get | ||
/// @param max_property_size size of the property value buffer | ||
/// @param property_value [out] pointer to the value of the memory property | ||
/// which will be filled | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. perhaps mention that value's type depends on the property (and link to |
||
/// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure | ||
umf_result_t umfGetMemoryProperty(umf_memory_properties_handle_t props_handle, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. const handle? |
||
umf_memory_property_id_t memory_property_id, | ||
size_t max_property_size, | ||
void *property_value); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* UMF_MEMORY_PROPS_H */ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,3 +144,6 @@ EXPORTS | |
umfJemallocPoolParamsDestroy | ||
umfJemallocPoolParamsSetNumArenas | ||
umfPoolGetName | ||
; Added in UMF_1.1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm... should we bump |
||
umfGetMemoryPropertiesHandle | ||
umfGetMemoryProperty |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,3 +141,8 @@ UMF_1.0 { | |
local: | ||
*; | ||
}; | ||
|
||
UMF_1.1 { | ||
umfGetMemoryPropertiesHandle; | ||
umfGetMemoryProperty; | ||
} UMF_1.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mention handle types, perhaps