X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f3b7e5f4b4d7c87ee3e8827313ec966ea8fc8387..39c935d6d5ee86d153f6f7e6a10d723ae7c57f6f:/examples/s4u/cloud-simple/s4u-cloud-simple.cpp diff --git a/examples/s4u/cloud-simple/s4u-cloud-simple.cpp b/examples/s4u/cloud-simple/s4u-cloud-simple.cpp index 65cc5feb7e..813eede223 100644 --- a/examples/s4u/cloud-simple/s4u-cloud-simple.cpp +++ b/examples/s4u/cloud-simple/s4u-cloud-simple.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -47,13 +47,11 @@ static void communication_rx_fun(std::vector args) const char* host_name = simgrid::s4u::this_actor::get_host()->get_cname(); simgrid::s4u::Mailbox* mbox = simgrid::s4u::Mailbox::by_name(args.at(0)); - const auto* payload = static_cast(mbox->get()); - double clock_end = simgrid::s4u::Engine::get_clock(); + auto payload = mbox->get_unique(); + double clock_end = simgrid::s4u::Engine::get_clock(); XBT_INFO("%s:%s to %s:%s => %g sec", payload->tx_host->get_cname(), payload->tx_actor_name, host_name, actor_name, clock_end - payload->clock_sta); - - delete payload; } static void launch_communication_worker(s4u_Host* tx_host, s4u_Host* rx_host)