Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Stop using SMX host->data to store MSG host
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 30 Apr 2012 23:29:48 +0000 (01:29 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 30 Apr 2012 23:35:04 +0000 (01:35 +0200)
- 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.

src/msg/msg_host.c

index 92f2cf1..a683d42 100644 (file)
@@ -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);
 }