From: Martin Quinson Date: Sat, 15 Oct 2016 14:47:44 +0000 (+0200) Subject: remove one malloc X-Git-Tag: v3_14~330 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1f465f6ad9152728e93e25eca5478aeebed3be22 remove one malloc --- diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index 968f5900fc..ec62ed4bbe 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -303,12 +303,11 @@ void NetworkNS3Model::updateActionsState(double now, double delta) action->getState() == Action::State::running){ double data_delta_sent = sgFlow->sentBytes_ - action->lastSent_; - std::vector *route = new std::vector(); + std::vector route = std::vector(); - routing_platf->getRouteAndLatency(action->src_->pimpl_netcard, action->dst_->pimpl_netcard, route, nullptr); - for (auto link : *route) + routing_platf->getRouteAndLatency(action->src_->pimpl_netcard, action->dst_->pimpl_netcard, &route, nullptr); + for (auto link : route) TRACE_surf_link_set_utilization (link->getName(), action->getCategory(), (data_delta_sent)/delta, now-delta, delta); - delete route; action->lastSent_ = sgFlow->sentBytes_; }