resource-monitor: Change prototype resource_monitor_get_value_string 12/279412/3
authorChanwoo Choi <cw00.choi@samsung.com>
Tue, 9 Aug 2022 03:55:19 +0000 (12:55 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 11 Aug 2022 09:46:43 +0000 (18:46 +0900)
Change prototype resource_monitor_get_value_string
and add description about free opearion of get_array functions.

Change-Id: Ibe9a8fa9db39457e90dcb637ee76a5d69d2186c7
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
include/resource-monitor.h
src/resouce-monitor.c

index b2294aa06eba68ac5c407d4f51054067cc415882..662cb5bd8ebc6b4340f06650f8d001640f4eed5c 100644 (file)
@@ -256,6 +256,8 @@ int resource_monitor_update_resource(int id, int resource_id);
 
 /**
  * @brief Get [int/int64/uint/uint64/double/string] value of resource attribute
+ * @details resource_monitor_get_value_string returns the value stored on allocated memory.
+ *          After using the value, must need to free the allocated memory of value.
  * @param[in] Resource monitor id
  * @param[in] Resource id
  * @param[in] Resource attribute id
@@ -267,10 +269,12 @@ int resource_monitor_get_value_int64(int id, int resource_id, u_int64_t attr, in
 int resource_monitor_get_value_uint(int id, int resource_id, u_int64_t attr, u_int32_t *value);
 int resource_monitor_get_value_uint64(int id, int resource_id, u_int64_t attr, u_int64_t *value);
 int resource_monitor_get_value_double(int id, int resource_id, u_int64_t attr, double *value);
-int resource_monitor_get_value_string(int id, int resource_id, u_int64_t attr, char *value);
+int resource_monitor_get_value_string(int id, int resource_id, u_int64_t attr, char **value);
 
 /**
  * @brief Get [int/int64/uint/uint64/double/string] array of resource attribute
+ * @details All get_array return the value stored on allocated memory.
+ *          After using the value, must need to free the allocated memory of value.
  * @param[in] Resource monitor id
  * @param[in] Resource id
  * @param[in] Resource attribute id
index 4a044a9a9f51e2b05065cce168742ced95fe13ee..1838358b9e45448c316a4b4f98813e458beb18b1 100644 (file)
@@ -102,7 +102,7 @@ int resource_monitor_get_value_double(int id, int resource_id, u_int64_t attr, d
        return pass_resource_monitor_get_value_double(id, resource_id, attr, value);
 }
 
-int resource_monitor_get_value_string(int id, int resource_id, u_int64_t attr, char *value)
+int resource_monitor_get_value_string(int id, int resource_id, u_int64_t attr, char **value)
 {
        return pass_resource_monitor_get_value_string(id, resource_id, attr, value);
 }