- MSG_mailbox_get_task_ext() -> MSG_task_receive_ext()
- MSG_mailbox_get_task_ext_bounded -> MSG_task_receive_ext_bounded
- MSG_host_(get/set)_params -> MSG_vm_(get/set)_params
+ * Don't pass the free_f parameter to property related functions:
+ - MSG_host_set_property_value()
+ - MSG_as_router_set_property_value()
+ - MSG_storage_set_property_value()
* VM properties. Since msg_vm_t are msg_host_t, just use
MSG_host_get_property_value() and friends
XBT_INFO(" Property: %s old value: %s", exist, value);
XBT_INFO("== Trying to modify a host property");
- MSG_host_set_property_value(thehost, exist, xbt_strdup("250"), xbt_free_f);
+ MSG_host_set_property_value(thehost, exist, xbt_strdup("250"));
/* Test if we have changed the value */
value = MSG_host_get_property_value(thehost, exist);
XBT_INFO(" Property: %s old value: %s", exist, value);
/* Restore the value for the next test */
- MSG_host_set_property_value(thehost, exist, xbt_strdup("180"), xbt_free_f);
+ MSG_host_set_property_value(thehost, exist, xbt_strdup("180"));
}
static int alice(int argc, char *argv[]) { /* Dump what we have on the current host */
xbt_dict_t props = sg_host_get_properties(h1);
/* Trying to set a new property */
- xbt_dict_set(props, "NewProp", strdup("newValue"), xbt_free_f);
+ xbt_dict_set(props, "NewProp", strdup("newValue"), NULL);
/* Print the properties of 'host1' */
xbt_dict_foreach(props, cursor, key, data) {
XBT_INFO("\tProperty: %s is undefined", exist);
else {
XBT_INFO("\tProperty: %s old value: %s", exist, value);
- xbt_dict_set(props, exist, strdup("250"), xbt_free_f);
+ xbt_dict_set(props, exist, strdup("250"), NULL);
}
/* Test if we have changed the value */
XBT_PUBLIC(sg_size_t) MSG_storage_get_used_size(msg_storage_t storage);
XBT_PUBLIC(msg_storage_t) MSG_storage_get_by_name(const char *name);
XBT_PUBLIC(xbt_dict_t) MSG_storage_get_properties(msg_storage_t storage);
-XBT_PUBLIC(void) MSG_storage_set_property_value(msg_storage_t storage, const char *name, char *value,void_f_pvoid_t free_ctn);
+XBT_PUBLIC(void) MSG_storage_set_property_value(msg_storage_t storage, const char* name, char* value);
XBT_PUBLIC(const char *)MSG_storage_get_property_value(msg_storage_t storage, const char *name);
XBT_PUBLIC(xbt_dynar_t) MSG_storages_as_dynar();
XBT_PUBLIC(msg_error_t) MSG_storage_set_data(msg_storage_t host, void *data);
/************************** AS Router handling ************************************/
XBT_PUBLIC(const char *) MSG_as_router_get_property_value(const char* asr, const char *name);
XBT_PUBLIC(xbt_dict_t) MSG_as_router_get_properties(const char* asr);
-XBT_PUBLIC(void) MSG_as_router_set_property_value(const char* asr, const char *name, char *value,void_f_pvoid_t free_ctn);
+XBT_PUBLIC(void) MSG_as_router_set_property_value(const char* asr, const char* name, char* value);
/************************** Host handling ***********************************/
XBT_PUBLIC(msg_host_t) MSG_host_by_name(const char *name);
XBT_PUBLIC(xbt_dict_t) MSG_host_get_properties(msg_host_t host);
XBT_PUBLIC(const char *) MSG_host_get_property_value(msg_host_t host,
const char *name);
-XBT_PUBLIC(void) MSG_host_set_property_value(msg_host_t host,
- const char *name, char *value,
- void_f_pvoid_t free_ctn);
-
+XBT_PUBLIC(void) MSG_host_set_property_value(msg_host_t host, const char* name, char* value);
XBT_PUBLIC(void) MSG_create_environment(const char *file);
* \param asr the name of a router or AS
* \param name a property name
* \param value what to change the property to
- * \param free_ctn the freeing function to use to kill the value on need
*/
-void MSG_as_router_set_property_value(const char* asr, const char *name, char *value,void_f_pvoid_t free_ctn) {
- xbt_dict_set(MSG_as_router_get_properties(asr), name, value,free_ctn);
+void MSG_as_router_set_property_value(const char* asr, const char* name, char* value)
+{
+ xbt_dict_set(MSG_as_router_get_properties(asr), name, value, nullptr);
}
* \param host a host
* \param name a property name
* \param value what to change the property to
- * \param free_ctn the freeing function to use to kill the value on need
*/
-void MSG_host_set_property_value(msg_host_t host, const char *name, char *value,void_f_pvoid_t free_ctn) {
- xbt_dict_set(MSG_host_get_properties(host), name, value,free_ctn);
+void MSG_host_set_property_value(msg_host_t host, const char* name, char* value)
+{
+ xbt_dict_set(MSG_host_get_properties(host), name, value, nullptr);
}
/** @ingroup m_host_management
* \param storage a storage
* \param name a property name
* \param value what to change the property to
- * \param free_ctn the freeing function to use to kill the value on need
*/
-void MSG_storage_set_property_value(msg_storage_t storage, const char *name, char *value,void_f_pvoid_t free_ctn) {
- xbt_dict_set(MSG_storage_get_properties(storage), name, value,free_ctn);
+void MSG_storage_set_property_value(msg_storage_t storage, const char* name, char* value)
+{
+ xbt_dict_set(MSG_storage_get_properties(storage), name, value, nullptr);
}
/** \ingroup m_storage_management
/** @brief Change the value of a given key in the property set */
void PropertyHolder::setProperty(const char*key, const char*value) {
if (!properties_)
- properties_ = xbt_dict_new();
- xbt_dict_set(properties_, key, xbt_strdup(value), &xbt_free_f);
+ properties_ = xbt_dict_new_homogeneous(xbt_free_f);
+ xbt_dict_set(properties_, key, xbt_strdup(value), nullptr);
}
/** @brief Return the whole set of properties. Don't mess with it, dude! */
xbt_dict_t PropertyHolder::getProperties() {
if (!properties_)
- properties_ = xbt_dict_new();
+ properties_ = xbt_dict_new_homogeneous(xbt_free_f);
return properties_;
}
msg_storage_t storage;
xbt_dynar_foreach(storages, cursor, storage){
XBT_INFO("Storage %s is attached to %s", MSG_storage_get_name(storage), MSG_storage_get_host(storage));
- MSG_storage_set_property_value(storage, "other usage", xbt_strdup("gpfs"), xbt_free_f);
+ MSG_storage_set_property_value(storage, "other usage", xbt_strdup("gpfs"));
}
xbt_dynar_free(&storages);
}