Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
more cleanups
[simgrid.git] / src / kernel / activity / SynchroIo.cpp
index 012165b..cccfbce 100644 (file)
@@ -4,8 +4,10 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/kernel/activity/SynchroIo.hpp"
-#include "src/surf/surf_interface.hpp"
 #include "src/simix/smx_private.h"
+#include "src/surf/FileImpl.hpp"
+#include "src/surf/StorageImpl.hpp"
+#include "src/surf/surf_interface.hpp"
 
 void simgrid::kernel::activity::IoImpl::suspend()
 {
@@ -24,13 +26,12 @@ void simgrid::kernel::activity::IoImpl::post()
   for (smx_simcall_t simcall : simcalls) {
     switch (simcall->call) {
     case SIMCALL_FILE_OPEN: {
-      smx_file_t tmp = xbt_new(s_smx_file_t,1);
-      tmp->surf_file = surf_storage_action_get_file(surf_io);
+      surf_file_t tmp = static_cast<simgrid::surf::StorageAction*>(surf_io)->file_;
       simcall_file_open__set__result(simcall, tmp);
       break;
     }
     case SIMCALL_FILE_CLOSE:
-      xbt_free(simcall_file_close__get__fd(simcall));
+      delete simcall_file_close__get__fd(simcall);
       simcall_file_close__set__result(simcall, 0);
       break;
     case SIMCALL_FILE_WRITE: