From: Martin Quinson Date: Sun, 11 Nov 2018 01:49:31 +0000 (+0100) Subject: MSG: kill the MSG_process_create_from_stdfunc() pimple X-Git-Tag: v3_22~806 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5f8c565f507bde7a0d755ce762ac9971d4430042 MSG: kill the MSG_process_create_from_stdfunc() pimple --- diff --git a/ChangeLog b/ChangeLog index 89b116148f..744c837fa4 100644 --- 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 diff --git a/include/simgrid/msg.h b/include/simgrid/msg.h index 887a70754c..a80493e6d8 100644 --- a/include/simgrid/msg.h +++ b/include/simgrid/msg.h @@ -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 code, void* data, - msg_host_t host, - std::unordered_map* properties); -#endif - #endif diff --git a/src/msg/msg_process.cpp b/src/msg/msg_process.cpp index 7f00a859ee..279ebff597 100644 --- a/src/msg/msg_process.cpp +++ b/src/msg/msg_process.cpp @@ -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(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* 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;