From: Martin Quinson Date: Mon, 30 Apr 2012 23:29:48 +0000 (+0200) Subject: Stop using SMX host->data to store MSG host X-Git-Tag: v3_7~34 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8d8d6b614e77190ba685eee6fafe653ca0b0eb1e?ds=inline Stop using SMX host->data to store MSG host - that's useless since we have the lib to retrieve the MSG_host data directly - it would break java bindings since it stores java object in there Pretty fucking bug, I've lost my day on this one. --- diff --git a/src/msg/msg_host.c b/src/msg/msg_host.c index 92f2cf1009..a683d423bb 100644 --- a/src/msg/msg_host.c +++ b/src/msg/msg_host.c @@ -46,7 +46,6 @@ m_host_t __MSG_host_create(smx_host_t workstation) } #endif - simcall_host_set_data(workstation, host); xbt_lib_set(host_lib,name,MSG_HOST_LEVEL,host); return host; @@ -61,16 +60,9 @@ m_host_t __MSG_host_create(smx_host_t workstation) */ m_host_t MSG_get_host_by_name(const char *name) { - smx_host_t simix_h = NULL; - simix_h = simcall_host_get_by_name(name); - - if (simix_h == NULL) - return NULL; - - return (m_host_t) simcall_host_get_data(simix_h); + return (m_host_t) xbt_lib_get_or_null(host_lib,name,MSG_HOST_LEVEL); } - /** \ingroup m_host_management * * \brief Set the user data of a #m_host_t. @@ -94,7 +86,6 @@ MSG_error_t MSG_host_set_data(m_host_t host, void *data) */ void *MSG_host_get_data(m_host_t host) { - return SIMIX_host_get_data(host->smx_host); }