From 36ff0407edc1324b5bd7ec989b36e99f200987f5 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 28 Aug 2016 22:08:05 +0200 Subject: [PATCH 1/1] kill two useless functions at once --- include/simgrid/host.h | 1 - src/simgrid/host.cpp | 3 --- src/simix/libsmx.cpp | 2 +- src/simix/smx_global.cpp | 2 +- src/simix/smx_host.cpp | 6 ------ src/simix/smx_host_private.h | 1 - 6 files changed, 2 insertions(+), 13 deletions(-) diff --git a/include/simgrid/host.h b/include/simgrid/host.h index 4321c24a66..6713ccfaa8 100644 --- a/include/simgrid/host.h +++ b/include/simgrid/host.h @@ -37,7 +37,6 @@ XBT_PUBLIC(void) sg_host_msg_set(sg_host_t host, msg_host_priv_t priv); // ========== Simix layer ============= XBT_PUBLIC(smx_host_priv_t) sg_host_simix(sg_host_t host); -XBT_PUBLIC(void) sg_host_simix_set(sg_host_t host, smx_host_priv_t priv); // ========= storage related functions ============ XBT_PUBLIC(xbt_dict_t) sg_host_get_mounted_storage_list(sg_host_t host); diff --git a/src/simgrid/host.cpp b/src/simgrid/host.cpp index 8c12c9c90c..77aa8ef1aa 100644 --- a/src/simgrid/host.cpp +++ b/src/simgrid/host.cpp @@ -95,9 +95,6 @@ void sg_host_msg_set(sg_host_t host, msg_host_priv_t smx_host) { smx_host_priv_t sg_host_simix(sg_host_t host){ return host->extension(); } -void sg_host_simix_set(sg_host_t host, smx_host_priv_t smx_host) { - host->extension_set(smx_host); -} // ========= storage related functions ============ xbt_dict_t sg_host_get_mounted_storage_list(sg_host_t host){ diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index 4fd6d54654..2fa37b7215 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -195,7 +195,7 @@ sg_host_t simcall_vm_create(const char *name, sg_host_t phys_host) { return simgrid::simix::kernelImmediate([&name, &phys_host] { sg_host_t host = surf_vm_model->createVM(name, phys_host); - SIMIX_host_create(host); + host->extension_set(new simgrid::simix::Host()); return host; }); diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index a47eaecd5a..6598f0732f 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -226,7 +226,7 @@ void SIMIX_global_init(int *argc, char **argv) sg_platf_init(); simgrid::surf::on_postparse.connect(SIMIX_post_create_environment); simgrid::s4u::Host::onCreation.connect([](simgrid::s4u::Host& host) { - SIMIX_host_create(&host); + host.extension_set(new simgrid::simix::Host()); }); simgrid::surf::storageCreatedCallbacks.connect([](simgrid::surf::Storage* storage) { diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index d2d8550198..f27e7accb6 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -53,12 +53,6 @@ namespace simgrid { } } -/** @brief Internal function to create a SIMIX host. */ -void SIMIX_host_create(sg_host_t host) -{ - sg_host_simix_set(host, new simgrid::simix::Host()); -} - /** @brief Start the host if it is off */ void SIMIX_host_on(sg_host_t h) { diff --git a/src/simix/smx_host_private.h b/src/simix/smx_host_private.h index 261fe15b28..5cfdd36b5b 100644 --- a/src/simix/smx_host_private.h +++ b/src/simix/smx_host_private.h @@ -38,7 +38,6 @@ namespace simgrid { typedef simgrid::simix::Host s_smx_host_priv_t; XBT_PRIVATE void _SIMIX_host_free_process_arg(void *); -XBT_PRIVATE void SIMIX_host_create(sg_host_t host); XBT_PRIVATE void SIMIX_host_add_auto_restart_process(sg_host_t host, const char *name, -- 2.20.1