From: Martin Quinson Date: Sat, 22 Oct 2016 00:25:15 +0000 (+0200) Subject: inline a function called only once X-Git-Tag: v3_14~290 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5f389553c3b6a2070fca0562c8143ff0b143ab52?ds=sidebyside inline a function called only once --- diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index 4c4bf39c65..a9ad2c9471 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -17,6 +17,7 @@ #include +#include #include #include "mc/mc.h" @@ -180,20 +181,19 @@ e_smx_state_t simcall_execution_wait(smx_activity_t execution) return (e_smx_state_t) simcall_BODY_execution_wait(execution); } - /** * \ingroup simix_vm_management * \brief Create a VM on the given physical host. * * \param name VM name - * \param host Physical host + * \param dest Physical host on which to create the VM * * \return The host object of the VM */ -sg_host_t simcall_vm_create(const char *name, sg_host_t phys_host) +sg_host_t simcall_vm_create(const char* name, sg_host_t dest) { - return simgrid::simix::kernelImmediate([&name, &phys_host] { - sg_host_t host = surf_vm_model->createVM(name, phys_host); + return simgrid::simix::kernelImmediate([&name, &dest] { + sg_host_t host = new simgrid::s4u::VirtualMachine(name, dest); host->extension_set(new simgrid::simix::Host()); return host; diff --git a/src/surf/VirtualMachineImpl.cpp b/src/surf/VirtualMachineImpl.cpp index 018f049fad..a2ab12e723 100644 --- a/src/surf/VirtualMachineImpl.cpp +++ b/src/surf/VirtualMachineImpl.cpp @@ -40,11 +40,6 @@ simgrid::xbt::signal onVmStateChange; std::deque VirtualMachineImpl::allVms_; -s4u::Host* VMModel::createVM(const char* name, s4u::Host* host_PM) -{ - return new s4u::VirtualMachine(name, host_PM); -} - /* In the real world, processes on the guest operating system will be somewhat degraded due to virtualization overhead. * The total CPU share these processes get is smaller than that of the VM process gets on a host operating system. */ // const double virt_overhead = 0.95; diff --git a/src/surf/VirtualMachineImpl.hpp b/src/surf/VirtualMachineImpl.hpp index ec006462cd..2e3b054d3d 100644 --- a/src/surf/VirtualMachineImpl.hpp +++ b/src/surf/VirtualMachineImpl.hpp @@ -103,13 +103,6 @@ protected: */ class VMModel : public HostModel { public: - /** - * @brief Create a new VM - * - * @param name The name of the new VM - * @param host_PM The real machine hosting the VM - */ - s4u::Host* createVM(const char* name, s4u::Host* host_PM); void adjustWeightOfDummyCpuActions() override{}; double nextOccuringEvent(double now) override;