code();
});
};
- register_function(name, std::move(code_factory));
+ register_function(name, code_factory);
}
template <class F> void register_actor(const std::string& name, F code)
{
kernel::actor::ActorCodeFactory code_factory = [code](std::vector<std::string> args) {
return kernel::actor::ActorCode([code, args] { code(std::move(args)); });
};
- register_function(name, std::move(code_factory));
+ register_function(name, code_factory);
}
void load_deployment(const std::string& deploy) const;
simgrid::jedule::Event event(std::string(SD_task_get_name(task)), SD_task_get_start_time(task),
SD_task_get_finish_time(task), "SD");
event.add_resources(*task->allocation);
- my_jedule->add_event(std::move(event));
+ my_jedule->add_event(event);
}
void jedule_sd_init()
context::Context::self()->get_actor()->kill(this);
// start the new actor
- ActorImplPtr actor =
- ActorImpl::create(arg.name, std::move(arg.code), arg.data, arg.host, arg.properties.get(), nullptr);
+ ActorImplPtr actor = ActorImpl::create(arg.name, arg.code, arg.data, arg.host, arg.properties.get(), nullptr);
*actor->on_exit = std::move(*arg.on_exit);
actor->set_kill_time(arg.kill_time);
actor->set_auto_restart(arg.auto_restart);
linkTemplate.bandwidths.push_back(this->bw_ * numlinks);
linkTemplate.latency = this->lat_;
linkTemplate.policy = this->sharing_policy_;
- linkTemplate.id = std::move(id);
+ linkTemplate.id = id;
sg_platf_new_link(&linkTemplate);
XBT_DEBUG("Generating link %s", linkTemplate.id.c_str());
resource::LinkImpl* link;
void RemoteSimulation::ignore_heap(IgnoredHeapRegion const& region)
{
if (ignored_heap_.empty()) {
- ignored_heap_.push_back(std::move(region));
+ ignored_heap_.push_back(region);
return;
}
auto* region = new Region(type, start_addr, size);
region->object_info(object_info);
- snapshot_regions_.push_back(std::unique_ptr<Region>(std::move(region)));
+ snapshot_regions_.push_back(std::unique_ptr<Region>(region));
}
void* Snapshot::read_bytes(void* buffer, std::size_t size, RemotePtr<void> address, ReadOptions options) const
INFO("Could not allocate destination memory");
REQUIRE(source != MAP_FAILED);
- return {.size = byte_size,
- .src = source,
- .dstn = destination,
- .region0 = std::move(region0),
- .region = std::move(region)};
+ return {.size = byte_size, .src = source, .dstn = destination, .region0 = region0, .region = region};
}
void snap_test_helper::read_whole_region()
simgrid::kernel::actor::ActorCode function;
if (code)
function = simgrid::xbt::wrap_main(code, argc, argv);
- actor->start(std::move(function));
+ actor->start(function);
}
sg_actor_t sg_actor_create(const char* name, sg_host_t host, xbt_main_func_t code, int argc, const char* const* argv)
{
simgrid::kernel::actor::ActorCode function = simgrid::xbt::wrap_main(code, argc, argv);
- return simgrid::s4u::Actor::init(name, host)->start(std::move(function)).get();
+ return simgrid::s4u::Actor::init(name, host)->start(function).get();
}
void sg_actor_set_stacksize(sg_actor_t actor, unsigned size)
kernel::actor::ActorCodeFactory code_factory = [code](std::vector<std::string> args) {
return xbt::wrap_main(code, std::move(args));
};
- register_function(name, std::move(code_factory));
+ register_function(name, code_factory);
}
void Engine::register_default(int (*code)(int, char**)) // XBT_ATTRIB_DEPRECATED_v329
{
kernel::actor::ActorCodeFactory code_factory = [code](std::vector<std::string> args) {
return xbt::wrap_main(code, std::move(args));
};
- register_function(name, std::move(code_factory));
+ register_function(name, code_factory);
}
/** Registers the main function of an actor that will be launched from the deployment file */
kernel::actor::ActorCodeFactory code_factory = [code](std::vector<std::string> args) {
return std::bind(std::move(code), std::move(args));
};
- register_function(name, std::move(code_factory));
+ register_function(name, code_factory);
}
/** Registers a function as the default main function of actors
*
void HostImpl::set_disks(const std::vector<kernel::resource::DiskImpl*>& disks, s4u::Host* host)
{
- disks_ = std::move(disks);
+ disks_ = disks;
for (auto d : disks_)
d->set_host(host);
}
XBT_DEBUG("Process %s@%s will be started at time %f", arg->name.c_str(), arg->host->get_cname(), start_time);
simgrid::simix::Timer::set(start_time, [arg, auto_restart]() {
simgrid::kernel::actor::ActorImplPtr new_actor = simgrid::kernel::actor::ActorImpl::create(
- arg->name.c_str(), std::move(arg->code), arg->data, arg->host, arg->properties.get(), nullptr);
+ arg->name.c_str(), arg->code, arg->data, arg->host, arg->properties.get(), nullptr);
if (arg->kill_time >= 0)
new_actor->set_kill_time(arg->kill_time);
if (auto_restart)
break;
}
}
- surf_parse_error(std::move(msg));
+ surf_parse_error(msg);
}
double surf_parse_get_double(const std::string& s)
for (std::string key : keys) {
if (simgrid::config::is_default(key.c_str())) {
std::string cfg = key + ":" + current_property_set->at(key);
- simgrid::config::set_parse(std::move(cfg));
+ simgrid::config::set_parse(cfg);
} else
XBT_INFO("The custom configuration '%s' is already defined by user!", key.c_str());
}
static void run_test_process(const std::string& name, simgrid::s4u::Host* location, int size)
{
std::vector<std::string> arg = {std::to_string(size)};
- simgrid::s4u::Actor::create(std::move(name), location, computation_fun, arg);
+ simgrid::s4u::Actor::create(name, location, computation_fun, arg);
}
static void test_energy_consumption(const std::string& name, int nb_cores)