Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MSG: kill the MSG_process_create_from_stdfunc() pimple
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 11 Nov 2018 01:49:31 +0000 (02:49 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 11 Nov 2018 01:59:33 +0000 (02:59 +0100)
ChangeLog
include/simgrid/msg.h
src/msg/msg_process.cpp

index 89b1161..744c837 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,11 @@ Core:
    with the Boost.Stacktrace library.
    You won't see your backtraces without this optional dependency.
 
+MSG:
+ - Drop MSG_process_create_from_stdfunc() from the API.
+   This C++ function was a pimple in the C API, made necessary at some
+   point by the Java bindings. This is fixed now.
+
 Fixed bugs:
  - #261: Document the parameters of parallel execution's constructor
 
index 887a707..a80493e 100644 (file)
@@ -460,10 +460,4 @@ MSG_process_get_smx_ctx(msg_process_t process);
 }
 #endif
 
-#ifdef __cplusplus
-XBT_PUBLIC msg_process_t MSG_process_create_from_stdfunc(std::string name, std::function<void()> code, void* data,
-                                                         msg_host_t host,
-                                                         std::unordered_map<std::string, std::string>* properties);
-#endif
-
 #endif
index 7f00a85..279ebff 100644 (file)
@@ -67,6 +67,8 @@ msg_process_t MSG_process_create_with_arguments(const char *name, xbt_main_func_
 msg_process_t MSG_process_create_with_environment(const char *name, xbt_main_func_t code, void *data, msg_host_t host,
                                                   int argc, char **argv, xbt_dict_t properties)
 {
+  xbt_assert(host != nullptr, "Invalid parameters: host param must not be nullptr");
+
   simgrid::simix::ActorCode function;
   if (code)
     function = simgrid::xbt::wrap_main(code, argc, static_cast<const char* const*>(argv));
@@ -79,19 +81,10 @@ msg_process_t MSG_process_create_with_environment(const char *name, xbt_main_fun
     props[key] = value;
   xbt_dict_free(&properties);
 
-  msg_process_t res = MSG_process_create_from_stdfunc(name, std::move(function), data, host, &props);
+  smx_actor_t process = simcall_process_create(name, std::move(function), data, host, &props);
   for (int i = 0; i != argc; ++i)
     xbt_free(argv[i]);
   xbt_free(argv);
-  return res;
-}
-
-msg_process_t MSG_process_create_from_stdfunc(std::string name, simgrid::simix::ActorCode code, void* data,
-                                              msg_host_t host, std::unordered_map<std::string, std::string>* properties)
-{
-  xbt_assert(code != nullptr && host != nullptr, "Invalid parameters: host and code params must not be nullptr");
-
-  smx_actor_t process = simcall_process_create(name, std::move(code), data, host, properties);
 
   if (process == nullptr)
     return nullptr;