- /* The root process (rank 0) first sends the token then waits to receive it back */
- XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->getName());
- neighbor_mailbox->put(xbt_strdup("Token"), task_comm_size);
- char* res = static_cast<char*>(my_mailbox->get());
- XBT_INFO("Host \"%u\" received \"%s\"", rank, res);
- xbt_free(res);
+ /* The root actor (rank 0) first sends the token then waits to receive it back */
+ XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->get_cname());
+ std::string msg = "Token";
+ neighbor_mailbox->put(&msg, task_comm_size);
+ const std::string* res = static_cast<std::string*>(my_mailbox->get());
+ XBT_INFO("Host \"%u\" received \"%s\"", rank, res->c_str());