#include <boost/range/algorithm.hpp>
+#include <xbt/ex.hpp>
+
+#include <simgrid/s4u/host.hpp>
+
#include "src/surf/surf_interface.hpp"
#include "src/simix/smx_private.h"
#include "xbt/log.h"
smx_mailbox_t mbox = (smx_mailbox_t) xbt_dict_get_or_null(mailboxes, name);
if (!mbox) {
- mbox = xbt_new0(s_smx_mailbox_t, 1);
+ mbox = new s_smx_mailbox_t();
mbox->name = xbt_strdup(name);
mbox->comm_queue = new std::deque<smx_synchro_t>();
mbox->done_comm_queue = nullptr; // Allocated on need only
xbt_free(mbox->name);
delete mbox->comm_queue;
delete mbox->done_comm_queue;
-
- xbt_free(mbox);
+ delete mbox;
}
smx_mailbox_t SIMIX_mbox_get_by_name(const char *name)
if (mbox->permanent_receiver!=nullptr){
//this mailbox is for small messages, which have to be sent right now
other_synchro->state = SIMIX_READY;
- other_comm->dst_proc=mbox->permanent_receiver;
+ other_comm->dst_proc=mbox->permanent_receiver.get();
other_comm->ref();
mbox->done_comm_queue->push_back(other_synchro);
other_comm->mbox=mbox;
{
unsigned int cursor;
smx_synchro_t synchro;
+ // The default result is -1 -- this means, "nothing is ready".
+ // It can be changed below, but only if something matches.
simcall_comm_testany__set__result(simcall, -1);
if (MC_is_active() || MC_record_replay_is_active()){