From c3ccc8e19ca6b65d9cc43fe0d7e2f0ec5fc5fa42 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 17 Oct 2016 09:10:44 +0200 Subject: [PATCH] simplification: inline a virtual function that is never derivated --- src/surf/HostImpl.cpp | 8 -------- src/surf/HostImpl.hpp | 2 -- src/surf/sg_platf.cpp | 6 +++++- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/surf/HostImpl.cpp b/src/surf/HostImpl.cpp index c425691ce9..6e97afd76d 100644 --- a/src/surf/HostImpl.cpp +++ b/src/surf/HostImpl.cpp @@ -29,14 +29,6 @@ simgrid::xbt::Extension HostImpl::EXTENSION_ID; /********* * Model * *********/ -HostImpl* HostModel::createHost(const char* name, Cpu* cpu, kernel::routing::NetCard* netcard, xbt_dynar_t storageList) -{ - HostImpl *host = new simgrid::surf::HostImpl(surf_host_model, name, storageList, cpu); - xbt_lib_set(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL, (void*)storageList); - - XBT_DEBUG("Create host %s with %ld mounted disks", name, xbt_dynar_length(host->storage_)); - return host; -} /* Each VM has a dummy CPU action on the PM layer. This CPU action works as the * constraint (capacity) of the VM in the PM layer. If the VM does not have any diff --git a/src/surf/HostImpl.hpp b/src/surf/HostImpl.hpp index a032f6c407..6734180cdf 100644 --- a/src/surf/HostImpl.hpp +++ b/src/surf/HostImpl.hpp @@ -51,8 +51,6 @@ class HostModel : public Model { public: HostModel() : Model() {} - HostImpl* createHost(const char* name, Cpu* cpu, kernel::routing::NetCard* net, xbt_dynar_t storageList); - virtual void adjustWeightOfDummyCpuActions(); virtual Action *executeParallelTask(int host_nb, sg_host_t *host_list, double *flops_amount, double *bytes_amount, double rate); diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 1d9ddd038f..7693e7c71b 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -19,6 +19,7 @@ #include "src/include/simgrid/sg_config.h" #include "src/surf/xml/platf_private.hpp" +#include "src/surf/HostImpl.hpp" #include "src/surf/cpu_interface.hpp" #include "src/surf/network_interface.hpp" #include "surf/surf_routing.h" // FIXME: brain dead public header @@ -110,7 +111,10 @@ void sg_platf_new_host(sg_platf_host_cbarg_t host) if (host->speed_trace) cpu->setSpeedTrace(host->speed_trace); - surf_host_model->createHost(host->id, cpu, netcard, mount_list)->attach(h); + simgrid::surf::HostImpl* hi = new simgrid::surf::HostImpl(surf_host_model, host->id, mount_list, cpu); + hi->attach(h); + xbt_lib_set(storage_lib, host->id, ROUTING_STORAGE_HOST_LEVEL, (void*)mount_list); + mount_list = nullptr; if (host->properties) { -- 2.20.1