#include "simgrid/forward.h"
#include "src/kernel/activity/ActivityImpl.hpp"
+#include <array>
#include <boost/intrusive_ptr.hpp>
/********************************* Simcalls *********************************/
-#include "popping_enum.h" /* Definition of e_smx_simcall_t, with one value per simcall */
+#include "popping_enum.hpp" /* Definition of e_smx_simcall_t, with one value per simcall */
-XBT_PUBLIC_DATA const char* simcall_names[]; /* Name of each simcall */
+XBT_PUBLIC_DATA const std::array<const char*, NUM_SIMCALLS> simcall_names; /* Name of each simcall */
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
+typedef void (*FPtr)(); // Hide the ugliness
/* Pack all possible scalar types in an union */
union u_smx_scalar {
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] = {};
+ std::array<u_smx_scalar, 11> args_ = {};
u_smx_scalar result_ = {};
};
template <class... A> inline void marshal(smx_simcall_t simcall, e_smx_simcall_t call, A const&... a)
{
simcall->call_ = call;
- memset(&simcall->result_, 0, sizeof(simcall->result_));
- memset(simcall->args_, 0, sizeof(simcall->args_));
+ memset(&simcall->result_, 0, sizeof simcall->result_);
+ memset(simcall->args_.data(), 0, simcall->args_.size() * sizeof simcall->args_[0]);
marshal_args<0>(simcall, a...);
}
}