Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make mailbox matching functions return a bool.
[simgrid.git] / src / simix / popping_private.hpp
index 00d77e2..1a7ce1c 100644 (file)
@@ -16,7 +16,7 @@
 
 XBT_PUBLIC_DATA const char* simcall_names[]; /* Name of each simcall */
 
-typedef int (*simix_match_func_t)(void*, void*, simgrid::kernel::activity::CommImpl*);
+typedef bool (*simix_match_func_t)(void*, void*, simgrid::kernel::activity::CommImpl*);
 typedef void (*simix_copy_data_func_t)(simgrid::kernel::activity::CommImpl*, void*, size_t);
 typedef void (*simix_clean_func_t)(void*);
 typedef void (*FPtr)(void); // Hide the ugliness
@@ -43,13 +43,13 @@ union u_smx_scalar {
  * @brief Represents a simcall to the kernel.
  */
 struct s_smx_simcall {
-  e_smx_simcall_t call_;
-  smx_actor_t issuer_;
-  smx_timer_t timeout_cb_; // Callback to timeouts
-  simgrid::kernel::actor::Transition* transition_ = nullptr;
-  int mc_value_;
-  u_smx_scalar args_[11];
-  u_smx_scalar result_;
+  e_smx_simcall_t call_                     = SIMCALL_NONE;
+  smx_actor_t issuer_                       = nullptr;
+  smx_timer_t timeout_cb_                   = nullptr; // Callback to timeouts
+  simgrid::mc::SimcallInspector* inspector_ = nullptr; // makes that simcall observable by the MC
+  int mc_value_                             = 0;
+  u_smx_scalar args_[11]                    = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
+  u_smx_scalar result_                      = {0};
 };
 
 #define SIMCALL_SET_MC_VALUE(simcall, value) ((simcall).mc_value_ = (value))
@@ -93,20 +93,20 @@ template <typename T> struct marshal_t {
   inline T unmarshal_raw(type<T>, u_smx_scalar const& simcall)                                                         \
   { /* Exactly same as unmarshal. It differs only for intrusive_ptr */ return simcall.field; }
 
-SIMIX_MARSHAL(bool, b);
-SIMIX_MARSHAL(char, c);
-SIMIX_MARSHAL(short, s);
-SIMIX_MARSHAL(int, i);
-SIMIX_MARSHAL(long, l);
-SIMIX_MARSHAL(unsigned char, uc);
-SIMIX_MARSHAL(unsigned short, us);
-SIMIX_MARSHAL(unsigned int, ui);
-SIMIX_MARSHAL(unsigned long, ul);
-SIMIX_MARSHAL(unsigned long long, ull);
-SIMIX_MARSHAL(long long, ll);
-SIMIX_MARSHAL(float, d);
-SIMIX_MARSHAL(double, d);
-SIMIX_MARSHAL(FPtr, fp);
+SIMIX_MARSHAL(bool, b)
+SIMIX_MARSHAL(char, c)
+SIMIX_MARSHAL(short, s)
+SIMIX_MARSHAL(int, i)
+SIMIX_MARSHAL(long, l)
+SIMIX_MARSHAL(unsigned char, uc)
+SIMIX_MARSHAL(unsigned short, us)
+SIMIX_MARSHAL(unsigned int, ui)
+SIMIX_MARSHAL(unsigned long, ul)
+SIMIX_MARSHAL(unsigned long long, ull)
+SIMIX_MARSHAL(long long, ll)
+SIMIX_MARSHAL(float, d)
+SIMIX_MARSHAL(double, d)
+SIMIX_MARSHAL(FPtr, fp)
 
 inline void unmarshal(type<void>, u_smx_scalar const& simcall)
 {